Top
Navigation
I'm talking about
Last bookmarks...
vendredi
08mai2009

Cocos2D AtlasSprite gotchas...

AtlasSprite is a great way to organize your animation and increase the performance by using a single image with all the frames for your animation, here is an example:

 But as I was trying to use it, I had a few issues, here is how to use the AtlasSpriteManager correctly:

  • You need to create a AtlasSpriteManager first to hold the texture of the sprite sheet.
  • You need to add the AtlasSpriteManager to the scene (otherwise, your AtlasSpriteS using that manager wont be visibles)
  • You need to pass that manager instance to your AtlasSprite init method.

It seems pretty clear now, but it wasn't the first time I implemented it.

samedi
02mai2009

Switching from custom UIKit / OpenGL code to cocos2d-iphone

In my first article, I will tell you the exciting story about me switching the "battle" rendering code of Urban Rivals iphone from a badly, underperforming, custom version using UIKit/OpenGL to a shorter yet more powerful & high performance version using the Cocos 2D library for iphone.

A little bit of history first... Urban Rivals iphone is my first project using objective-c & the cocoa environnement. Beeing an impatient man, I started right away with UR beside the basic Helloworld..

-(void) dealloc
{
    
    for (Sprite *sprite in padFlashes) {
        [sprite release];
    }   
    [soundEngine release];
    [slider release];
    [super dealloc];
}
Page 1 ... 2 3 4 5 6