Now we have our basic game world, we have walls, and a ball that will drop off of the bottom of the screen. We need to turn our attention to the only piece of the game the user directly controls: the paddle. Let's look at how we build it:
-(void) buildPaddleAtStartingPosition:(CGPoint)startPos { // Create the paddle paddle = [PhysicsSprite spriteWithSpriteFrameName: @"paddle.png"]; paddle.position = startPos; paddle.tag = kPaddle; [bricksheet addChild: paddle]; // Create paddle body b2BodyDef paddleBodyDef; paddleBodyDef.type = b2_dynamicBody; paddleBodyDef.position.Set(startPos.x/PTM_RATIO, startPos.y/PTM_RATIO); paddleBodyDef.userData = paddle; paddleBody = world->CreateBody(&paddleBodyDef); // Connect the body to the sprite [paddle setPhysicsBody:paddleBody]; // Build normal size fixure ...