Adapting the Game
You can do plenty of things to customize or adapt this game. We’ve kept the logic simple for demonstration purposes, but you could make the game randomly decide whether the ball bounces left or right when it hits the bat, so it feels more chaotic and realistic. You can add in Pygame sound effects, using pygame.mixer, which is demonstrated in Chapter 16. You can make your own map, change the colors used, and add in new colored bricks. Perhaps you could modify it to display the score total during the game, and to incorporate multiple levels of gameplay. Remixing existing programs like this is a good way to study how they work, and to generate ideas for your own original games. If you come up with improvements, we’d love to see them!
You can find in-depth Pygame documentation (and information about features we don’t have room for here) at
www.pygame.org. You can find comprehensive documentation for Python online at