EzDevInfo.com

SpriteBuilder

Objective-C Game Development Suite SpriteBuilder – Build brilliant games at top speed.

how to change spritebuilder Project name

i'am developing an game in xcode for iPhone ,i'am using spritebuilder ,in start i have just named it and now i want to change my sprite builder Project name . How do I rename a spritebuilder project ?


Source: (StackOverflow)

Cocos2d - Change CCNode Image Programmatically

Does anyone know how to change a CCNode's image programmatically? I'm using SpriteBuilder to make a simple game.


Source: (StackOverflow)

Advertisements

Admob in Cocos2d and SpriteBuilder

Hello! My game is almost done. But now I want to add ads. I use ADMob. I red the instructions but I don't have a ViewController. Because I am coding in Cocos2d & using SpriteBuilder to connect everything I only have a MainScene.m and MainScene.h.

I don't know what to do. I searched everywhere but can't find anyone in my situation.

Can someone out there please help me? My game is done, it's just the ads left. Then I'm going to pay $99 for the IOS Developer.

Thanks :)


Source: (StackOverflow)

iOS app validation error: Missing plist key CFBundleShortVersionString

I built an iOS game with SpriteBuilder and cocos2d. When I attempt to submit it to the AppStore, I get the following error:

ERROR ITMS-9000: "Missing plist key. The Info.plist file is missing the required key: CFBundleShortVersionString."

How do I fix this? Thanks!


Source: (StackOverflow)

Sprite Builder can't find the variable define in objective c class

I am making a game given in makeagamewithus.com named "PeevedPenguins".
I put _physicsNode variable in spritebuilder for gameplay scene and put CCPhysicsNode *_physicsNode in implementation class Gameplay as given in this Link.
But get an error CBReader: Couldn't find member variable: _physicsNode


Source: (StackOverflow)

Please ! I need help on PhysicsBody in SpriteBuilder

That is the error message from Xcode:

-[CCNode setupPhysicsBody:] : Failed to find a parent CCPhysicsNode for this 
CCPhysicsBody. The CCPhysicsBody requires it be the child of a CCPhysicsNode when 
onEnter is called.

Source: (StackOverflow)

Replacing Occurrences of Strings in NSMutableArray Only Working Once

I am confounded, and perhaps have missed something simple, but I can't find it.

I'll do this problem in theoretical, because I have done a test and still cannot get it to work with stripped down code. I am using SpriteBuilder, but that shouldn't be what is causing the issue - I can log the value I am getting in the text input, but simply cannot get that value into the array a second time - but enough ranting, time for some code.

Main.h

#import "Content.h"
#import "ReplaceMe.h"

@property Content *contentInstance;
@property ReplaceMe *replaceMeInstance; 

Main.m

   -(void)someFunction{
    _contentInstance = (Content*)[CCBReader load:@"ContentScene"];
  [_contentInstance.changeArray enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
        if ([_contentInstance.base[idx] containsString:@"one"]){
            NSLog(@"I contain one!");
            NSString *replace = [_content.testArray[idx] stringByReplacingOccurrencesOfString:@"one" withString:changeTheText.string];
            [_content.testArray replaceObjectAtIndex:idx withObject:replace];
            NSLog(@"%@",_content.testArray[idx]);
        }
    }];
[_contentInstance updateLabels];
    }

Content.h

@property NSArray *base;
@property NSArray *changeArray;

Content.m

-(void)someFunction{
    _base = @[@"This is one",@"This is two",@"This is two point one"];
    _changeArray = [base mutableCopy];
}
-(void)updateLabels{
    [_changeArray enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
        _labeler = [CCLabelTTF labelWithString:[NSString stringWithFormat:@"%@",_changeArray[idx]] fontName:@"Helvetica" fontSize:12.0f];
        }
    }];
}

ReplaceMe.h

@property CCTextField *changeTheText;
-(void)_changeTheTextSelector;

ReplaceMe.m

-(void)_changeTheTextSelector{
self.visible=NO;
}

When I call MainScene's someFuction, this set up works just dandy the first time - and only the first time. I can't get changeArray to update after the first time I run the enumeration.

I know that changeTheText is changing, as it logs out, but when I log changeArray[idx], it is stuck at the first changeTheText.

Any ideas?


Source: (StackOverflow)

Could not build module 'Foundation' in Xcode 6

I have searched Stack Overflow, Google and fellow peers for a current workaround in Xcode 6 for this error but have failed in doing so.

Note that this error occurs ONLY when attempting to run my app ON A DEVICE USING XCODE 6. (This is not an issue when using the simulators, and I can build my app on a device using Xcode 5)

It seems to be a framework or library issue, but since it is able to work in almost every other possible way, I am not sure where the solution resides. I was using Xcode 6.0.

Here is the error:

error1

error

I have checked my architecture settings, my frameworks and project files. Everything that needs to be included seems to be there. arch

This looks like it might be a silly error to do with Cocos2d and/or Xcode6. I have used SpriteBuilder to create the app. If you have a fix or have this error, any insight would be appreciated, thank you!


Source: (StackOverflow)

some aspects of cocos2d not working with spritebuilder?

I'm fairly new to developing with apple and everything and I just recently got into spritebuilder (or formerly known cocosbuilder) There is this problem that is just boggling my mind.

From this line in XCode:

[_bird runAction:[CCSequence actions:bird_floatAnimation,nil];

when I type CCSequence just about anywhere I get unknown reciever ccsequence, did you mean ccbsequence? same thing with CCRepeatForever. Funny thing is that I can use CCActionMoveTo and CCActionMoveBy and run it and it works fine.

So what happened? This is driving me insane. I am using SpriteBuilder 1.0 with Cocos2d v3.


Source: (StackOverflow)

hiding iAd in Cocos2d V3.0

i'm using Cocos2d-iphone v3.0 combined with sprite-builder to build my app.I just recently got iAd working following the answer seen here: How to add iAd in Cocos-SpriteBuilder

So i wont repeat any of the code, the only thing I changed from the posted answer was _adView to _bannerView in init statement. Now I have adds showing where I want but I dont know how to hide them. I would like to have the adds only visible in the game scene after you loose. When you loose I run a gameover event that displays your highscore and a restart button amongst other things so setting a variable like canShowAds to true there and false when the scene starts seems like what I would have to do but I don't know how to only run the ads when its equal to true. Also I plan on having a remove ads button so I would need to check if that has been purchased. If you need anymore code posted I will gladly post it. :)


Source: (StackOverflow)

CCProgressNode for Health Bar not working

I have recently discovered that the CCProgressTimer class is replaced with CCProgressNode in the latest version of cocos2d, however, when i tried to implement the following code, there is nothing happen to the progressNode I have read all kinds of documentation, it seems like I have used all the latest methods. This all happens in gamePlay Class This is how I define the node.

CCProgressNode *_healthBar;
float _life;

This is the setUp method

- (void)initializeHealthBar {
    self->_healthBar = [[CCProgressNode alloc] init]; // This wasn't there before, but thought   it might be the memory allocation problem,
    // _health is the code connection between sprite builder and Xcode.
    self->_healthBar = [CCProgressNode progressWithSprite:_health]; 
    [_healthBar setType:CCProgressNodeTypeBar];
    [_healthBar setPercentage:_life];
    [_healthBar setBarChangeRate:ccp(0.1,0.1)];
    _healthBar.position = _health.position;
    // So the _healthBar turns out positioned correctly, because _health is already positioned in sprite builder
    [_contentNode addChild:_healthBar];

}

This is how i Involk the change on health bar... (It works, the healthBar is depleting... )

-(void) hit {
    if(_healthBar.percentage > 0)
    {
    self->_life -= 34;
    self->_healthBar.percentage -= 34;
    }
    if (self->_healthBar.percentage <= 0 && ![_myHero isGameOver]) {
        self->_healthBar.percentage = 0;
        [_myHero isGameOver: TRUE];
        [self gameOver];
    }
}

Source: (StackOverflow)

Spritebuilder project with wrong node positions in xcode 6

I've been using spritebuilder to play around with a few design ideas. I recently upgraded xcode to xcode 6 and my node positions have ended up being a bit screwy. I was wondering if anyone else is having these issues.

What I get on spritebuilder vs how it ends up looking like on ios simulator enter image description here

Deploying to an actual ios device with ios 7 works correctly.


Source: (StackOverflow)

Published-iOS file published by SpriteBuilder didn't synchronize over bitBucket

I'm using SpriteBuilder to publish cocos2d V3 project. And share the project file over SourceTree and BitBucket.

Almost Every files are synchronized except for Published-iOS file.

It all solved after sending the missing file to my team crew and he put it into place.

But it requires extra work for each push.

Does anyone know how to fix it?


Source: (StackOverflow)

Change default app icon and loading screen in SpriteBuilder

I'm making a game with SpriteBuilder and cocos2d in Objective-C and don't know how to change the default loading image an app icons in SpriteBuilder. Does anyone know how to do that


Source: (StackOverflow)

How to use Custom Class for CCSprite?

I'm trying to do the tutorial for this:

https://www.makegameswith.us/gamernews/384/build-your-own-2048-with-spritebuilder-and-cocos2d

I want to add CCSprite for the above tutorial. I laid out the CCSprite in Spritebuilder and turn their visibility off at first. When the respective tile appear, only then the CCSprite will be visible. For example, when Tile A first appear, then CCSprite A will appear. When Tile A merge with another Tile A, Tile B will appear and so does CCSprite B and so on.

The problem is that the switch case used to determine the tile value is located at Grid.m but the CCSprite added to Spritebuilder is under the CCNode of MainScene class. If i don't put custom class for CCSprite, XCode couldn't find the member variable. If i put custom class of "Grid" for CCSprite, XCode would return error of "This class is not key value coding-compliant for the key spriteFrame." What should i do here?


Source: (StackOverflow)