O'Reilly logo

Raspberry Pi For Dummies by Mike Cook, Sean McManus

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 www.python.org .

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required