Skip to Content
Python Crash Course, 3rd Edition
book

Python Crash Course, 3rd Edition

by Eric Matthes
January 2023
Intermediate to advanced content levelIntermediate to advanced
552 pages
13h 38m
English
No Starch Press
Content preview from Python Crash Course, 3rd Edition

14 Scoring

In this chapter, we’ll finish building Alien Invasion. We’ll add a Play button to start the game on demand and to restart the game once it ends. We’ll also change the game so it speeds up when the player moves up a level, and we’ll 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 that feature complete scoring systems.

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

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Automate the Boring Stuff with Python, 2nd Edition

Automate the Boring Stuff with Python, 2nd Edition

Al Sweigart

Publisher Resources

ISBN: 9781098156664