15Creating Mr. Stick Man
In this chapter, we’ll create the main character of Mr. Stick Man Races for the Exit. This will require the most complicated coding we’ve done so far, because Mr. Stick Man needs to run left and right, jump, stop when he runs into a platform, and fall when he runs off the edge of a platform. We’ll use event bindings for the left and right arrow keys to make the stick figure run left and right, and we’ll have him jump when the player presses the spacebar.
Initializing the Stick Figure
The __init__ function for our new stick figure class will look a lot like those in the other classes in our game. We start by giving our ...
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.