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

III. Mr. Stick Man Races for the Exit > 16. Developing the Mr. Stick Man Game

Chapter 16. Developing the Mr. Stick Man Game

Now that we’ve created the images for our Mr. Stick Man Races for the Exit game, we can begin to develop the code. The description of the game in the previous chapter gives us a basic idea of what we need: a stick figure that can run and jump, and platforms that he must jump to.

We’ll need code to display the stick figure and move it across the screen, as well as to draw platforms. But before we write that code, we need to create the canvas to display our background image.

Creating the Game Class

First, we’ll create a class called Game, which will be our program’s main controller. The Game class will have an __init__ function for initializing the game and a mainloop function for doing the animation.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

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

  

Start a Free 10-Day Trial


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