Now that we know what type of game we will be playing, we have enough information to build the rack on the table. First we need to know how to build the balls.
-(void) createBall:(BallID)ballID AtPos:(CGPoint)startPos { // Create the filename NSString *ballImg = [NSString stringWithFormat:@"ball_%i.png",ballID]; // Create sprite and add it to layer OPBall *ball = [OPBall spriteWithSpriteFrameName:ballImg]; ball.position = startPos; ball.tag = ballID; [self addChild:ball z:10]; // Create ball body b2BodyDef ballBodyDef; ballBodyDef.type = b2_dynamicBody; ballBodyDef.position.Set(startPos.x/PTM_RATIO, startPos.y/PTM_RATIO); ballBodyDef.userData = ball; b2Body *ballBody = world->CreateBody(&ballBodyDef); // Store the body in the sprite [ball setPhysicsBody:ballBody]; //Create a circle shape b2CircleShape...