Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

II. Bounce! > 13. Beginning Your First Game: Bounce!

Chapter 13. Beginning Your First Game: Bounce!

So far, we’ve covered the basics of computer programming. You’ve learned how to use variables to store information, if statements for conditional code, and for loops for repeating code. You know how to create functions to reuse your code, and how to use classes and objects to divide your code into smaller chunks that make it easier to understand. You’ve learned how to draw graphics on the screen with both the turtle and tkinter modules. Now it’s time to use that knowledge to create your first game.

Whack the Bouncing Ball

We’re going to develop a game with a bouncing ball and a paddle. The ball will fly around the screen, and the player will bounce it off the paddle. If the ball hits the bottom of the screen, the game comes to an end. Here’s a preview of the finished game:


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint