Nov 142011
 

Tip: Quick tip to swap out the image of a sprite that has already been initialized with an image. CCSprite *sprite = [CCSprite spriteWithSpriteFrameName@"oldImage.png"]; [sprite setDisplayFrame:[[CCSpriteFrameCache sharedSpriteFrameCache] spriteFrameByName:@”newImage.png”]];

 Posted by at 6:04 pm
Sep 132011
 

To Collide or Not to Collide When you create simple Box2d objects, they will collide with each other. But what if you do not want an object colliding with all other objects? What if you want certain objects colliding with only certain other objects? How do we achieve this finer grained control? Say that our [...]

 Posted by at 9:03 am
Jan 072011
 
Beginning Box2D Physics Engine

What Is It? Cocos2d comes with two physics engines. One is called Chipmunk and the other is called Box2d. Chipmunk sounds cuter and is written in C, whereas Box2D is written in C++. I chose to learn Box2d because it seems to be the more popular and mature of the two. Instead of trying to [...]