Unlike impulses, forces must be applied over time to significantly move a body in the physical world. In this recipe, we see a simulation of our solar system.
Execute the following code:
@implementation Ch4_Forces -(CCLayer*) runRecipe { [super runRecipe]; //Set our gravity to 0 world->SetGravity(b2Vec2(0,0)); //Level background CCSprite *bg = [CCSprite spriteWithFile:@"solar_system_bg.png"]; bg.position = ccp(240,160); [gameNode addChild:bg z:0]; //Add Planets planets = [[[NSMutableDictionary alloc] init] autorelease]; [[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@"solar_system.plist"]; [self addPlanetWithSpriteFrameName:@"sun.png" position:ccp(240,160)]; [self addPlanetWithSpriteFrameName:@"mercury.png" position:ccp(210,160)]; [self addPlanetWithSpriteFrameName:@"venus.png" position:ccp(195,160)]; [self...