20USING SOUNDS AND IMAGES

image

In Chapters 18 and 19, you learned how to make GUI programs that have graphics and can accept input from the keyboard and mouse. You also learned how to draw different shapes. In this chapter, you’ll learn how to add sounds, music, and images to your games.

Adding Images with Sprites

A sprite is a single two-dimensional image that is used as part of the graphics on a screen. Figure 20-1 shows some example sprites.

Figure 20-1: Some examples of sprites

The sprite images are drawn ...

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.