Tag Archive for ‘cocos2d’
Tutorial: CDAudioManager and CDSoundEngine
Intro This post came from a need for more flexibility than was offered from SimpleAudioEngine. If you are new to iOS audio, I would highly recommend you check out SimpleAudioEngine (my tutorial here). If all you need is background music and sound effects, it is perfect for you. The flexibility that I needed stemmed from
Continue reading »Quick Code: CCNode setPosition: #macro (You will love this!)
For those that love cocos2d as much as I do, you know that basically everything is a subclass of CCNode. Position is a the location in points (not pixels) of a CCNode where (0,0) is the bottom left corner of the parent object. Once you get into writing cocos2d apps, you will find that you
Continue reading »Quick Code: Starting and Stopping SpaceManager
I plan on doing a longer tutorial on SpaceManager a little bit later but for right now I wanted to post a quick bit of code that should seem rather obvious, but took me a while to figure out. Straight from the SpaceManager website: SpaceManager was designed specifically to target chipmunk for use on the
Continue reading »Fun Bugs: Adding Chipmunk to cocos2d Woes
Have you tried to add Chipmunk to a cocos2d project and received the dreaded… No such file or directory: Constraints/util.h Have you scoured the interwebs and found to relief to your compiler woes? Welcome to the solution Many places around the interwebs tell you update your User Header Search Paths to “$(SRCROOT)/libs/Chipmunk/include/chipmunk” Well this looks fine and
Continue reading »Quick Code: CCLabelTTF color
Tired of the same old white labels with CCLabelTTF in cocos2d? Changing the color is super simple! CCLabelTTF *label = [CCLabelTTF labelWithString:@"I love Paw Apps!" fontName:@"Marker Felt" fontSize:36.0f]; [label setPosition:ccp(200,200)]; // Notice the following three ways all do the same thing. // The color is set to Blue, Red, and then Green. // Of
Continue reading »Mobclix and cocos2d
I have been working with cocos2d for a few months now and I can tell you for a fact that the level of awesomeness is very awesome in itself. This isn’t a post strictly about cocos2d, so I’ll leave it at that, but I could sing it’s praise (which I most likely will) in many
Continue reading »GameCenter on devices older than iOS 4.1
So incase you are not aware, GameCenter is not available on iOS devices prior to iOS 4.1 (see GameCenter guide here). So this leaves us at a crossroads. If I want to use GameCenter in my app, what do I do about the devices that don’t have GameCenter available? Before we get too much further
Continue reading »Quick Code: CCLayerColor and CCLayerGradient
Today’s quick code is about using CCLayerColor and CCLayerGradient. These two objects are very useful for one, because of their simplicity, and for two, they keep you from making new sprite objects. Before I knew these objects existed, I would create a solid color 480×360 and 960×720 solid color image to use as a background
Continue reading »Quick Code: performSelector:withObject:afterDelay:
Awesome little bit of code here. Any time you want a bit of code to run in the future, you can schedule it to run after a number of seconds delay. For this you use performSelector:withObject:afterDelay:. It really works just as simple as it looks. Here’s a quick example: [mySprite performSelector:@selector(setVisible:) withObject:[NSNumber numberWithBool:YES] afterDelay:2.0f]; This
Continue reading »Tutorial: Transitions in Cocos2d
Cocos2d is beautiful. It really is. One of the best features is the transitions between scenes. In order to transition between two scenes, you only need one line of code and it is as follows: [[CCDirector sharedDirector] replaceScene:[CCTransitionCrossFade transitionWithDuration:0.5f scene:[NewScene scene]]]; In the example above, the visual transition is CCTransitionCrossFade. At the moment there are
Continue reading »

Recent Comments