In this adventure, you’ll learn how to use images with Python and
PyGame. During previous adventures you’ve used
PyGame’s drawing functions to draw shapes. You’ve discovered how flexible this is and how much it allows you to do, but it can’t do everything! Sometimes you will want to use images from other programs instead of drawing them with code.
During this adventure, you’ll create programs to load and layer images. You’ll create a program that lets you add a moustache to any image and another program to move a sprite around the window, which forms the basis of a game.
The first thing you’ll do in this adventure is learn how to load and display an image. Before you can start, you’ll need to save your chosen images into the folder that the program will be saved in. In this adventure I’ve chosen the images for you. To download these images, follow the steps given in the Appendix.
Finished? Once you have the images, copy all of them into the
Adventure 8 folder.
The first images you will be using are
space.png. Make sure they are in ...