image

16DEVELOPING 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 ...

Get Python for Kids 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.