13.4 Creating Your Own Video Game

By now, you should have a good understanding of event-driven programming using the turtle module. We will finish this chapter by pulling everything together to create a simple video game—our updated version of the old Space Invaders game, in which aliens appear in the sky and you must shoot them with a laser cannon before they reach the ground. In our game, however, drones will appear in the sky rather than aliens.

Figure 13.4 shows a screenshot of the game in action. In the figure, notice the three main objects that we will implement to develop our video game. At the bottom center of the window is the laser cannon, which is the usual turtle triangle. The drones are the enemies, and the small circles are the ...

Get Python Programming in Context, 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.