Program Arcade GamesWith Python And Pygame
Lab 9: Sprite Collecting
This lab practices using Pygame sprites as described in Chapter 14.
- Start with an empty directory and put all of the lab-related files in this directory.
- Start with the following program:
- Modify it so the player moves with the keyboard rather than the mouse. Take a look at the move_sprite_keyboard_smooth.py program also available on the example page.
- Create another list of sprites, one that decreases the player score instead.
- Color the player blue, the good sprites green, and the bad sprites red. Or use graphics to signify good/bad sprites as shown in the sprite_collect_graphic.py example file.
- Rather than simply use print to display the score on the console, display the score on the graphics window. Go back to simple_graphics_demo.py for an example of displaying text.
- Add sound effects for when the user hits good blocks, or bad blocks. Here are a couple
- Add a check and make sure the player doesn't slide off the end of the screen.
- Download a wav file and have it play a sound if the user tries to slide off the screen. Here's one
sound you can use:
You are not logged in. Log in here and track your progress.