Multi Touch in Cocos2D-X

This has been updated for Cocos2D-X build 2.1.2 (cocos2d-2.1rc0-x-2.1.2.zip @ Mar.20, 2013). [wpdm_file id=5] I’ve just been needing multi-touch in my current game project, it turned out to…

Read More

Cocos2D – Animation with Defined Frames

To animate a sprite with a set number of frames and then stop: CCAnimation *anim = anim = [[CCAnimation alloc] initWithName:@”idle” delay:0.1f]; [anim addFrame:[[CCSpriteFrameCache sharedSpriteFrameCache] spriteFrameByName: @”frame_1.png”]]; [anim…

Read More

Cocos2D – Change a Sprites Image

To change a sprites image frim the cache using its filename (frameName): CCSpriteFrame *frame = [[CCSpriteFrameCache sharedSpriteFrameCache] spriteFrameByName:frameName]; [self setDisplayFrame:frame];

Read More