1. Introduction
  2. Draw a Circle
  3. Add Some Color
  4. Action
  5. Library: an Interlude
  6. Bounce
  7. Add a Paddle
  8. The Keyboard
  9. The Mouse
  10. The Bricks
  11. Finishing Touches
  12. Coda

Add a Paddle

Now we can start to think about making our game a bit like an actual game. Let's add a paddle, and only allow the ball to bounce off the bottom when it hits it.

You probably want to be able to move the paddle - we'll cover that in the next page.

The constants paddlex, paddleh, and paddlew will be moved to the regular init() function from now on.

next prev