14Developing the Mr. Stick Man Game

Image

Now that we’ve created the images for Mr. Stick Man Races for the Exit, we can begin developing the code. The description of the game in the previous chapter gives us an idea what we’ll need: a stick figure that can run and jump and platforms he must jump to. We’ll write code to display the stick figure and move it across the screen, as well as to display the platforms. But before we write this code, we need to create the canvas to display our background image.

Creating the Game Class

First, we’ll create a class called Game that will be our program’s main controller. The Game class will have an __init__ function ...

Get Python for Kids, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.