21A DODGER GAME WITH SOUNDS AND IMAGES

image

The previous four chapters went over the pygame module and demonstrated how to use its many features. In this chapter, we’ll use that knowledge to create a graphical game called Dodger.

In the Dodger game, the player controls a sprite (the player’s character) who must dodge a whole bunch of baddies that fall from the top of the screen. The longer the player can keep dodging the baddies, the higher their score will get.

Just for fun, we’ll also add some cheat modes ...

Get Invent Your Own Computer Games with Python , 4th 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.