14SCORING

Image

In this chapter, we’ll finish the Alien Invasion game. We’ll add a Play button to start a game on demand or to restart a game once it ends. We’ll also change the game so it speeds up when the player moves up a level, and implement a scoring system. By the end of the chapter, you’ll know enough to start writing games that increase in difficulty as a player progresses and show scores.

Adding the Play Button

In this section, we’ll add a Play button that appears before a game begins and reappears when the game ends so the player can play again.

Right now the game begins as soon as you run alien_invasion.py. Let’s start the game in an inactive ...

Get Python Crash Course, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.