- Learn Linux
- Learn Electronics
- Raspberry Pi
- LPI certification
- News & Reviews
This is my second professionally published book, published by Apress.
The is a fun way to learn computer programming by creating computer games. This is designed as a book to give you all the skills you need to start programming your own games, from designing the game, creating the graphics, designing sound effects and programming using Pygame Zero.
Here is a quick introduction to the main focus for each of the chapters.
An introduction to the methodology around programming, creating computer games and the Raspberry Pi.
A quick introduction to Python. Designed for those with programming experience from a language other than Python, or as a quick refresher for those that have done some programming in Python before. It introduces the first game which is a text based quiz. This is the only console based game with the rest being designed using Pygame Zero.
An introduction into what Pygame Zero is, along with an introduction to using the Mu editor with Pygame Zero. Create a first graphical game "Compass Game" and learn about how sprites (Actors) can be animated. Learn how to detect collisions in Pygame Zero.
This chapter goes outside of purely programming to investigate what makes a game enjoyable. It gives ideas of what to think about when designing a game. The code then looks at making the compass game more enjoyable through a more appropriate timer and adding obstacles.
To create graphical games then you need to know about how to create the graphics and how to incorporate them into the game. This chapter looks at how you can create graphics using 2D and 3D tools before exporting them for inclusion in a 2D game.
Understand how colors are represented in a computer and how they are used in Pygame Zero. This creates a color changing bouncing ball animation and a color changing which introduces how to handle mouse events in Pygame Zero.
Create a tank based game using Vector Graphics based around basic shapes. Also learn about creating a shell tragectory and how to introduce gravity into a game.
How to record or make sounds and music for use in games. How to use these to create sound effects or to play background music during the game. This chapter introduces a piano / keyboard style game designed for use with the Raspberry Pi touch screen.
Learn about object oriented programming with Python as a way to make code easier to understand. This creates a matching pairs memory game which you can play against the clock to try and find as many pairs as you can.
How to create computer players with an appropriate level of "intelligence". This looks at the memory game and looks at different techniques that can be used to provide a computer competitor instead of the timer. Also creates a new Battleship game using appropriate artificial intelligence to make the game challenging.
Learn additional techniques in Pygame and Pygame Zero. Look at how to create games for the Raspberry Pi Picade and a quick introduction to joysticks / game controllers. Some tips and trips for debugging, including Rubber Duck Debugging.
After following through the book you should have learnt enough skills to adapt the games or create your own games using Pygame Zero.
* Note the American spelling of color rather than the Britsh English spelling colour which is what I normally use on this website. I live in the United Kingdom and so use British English on my website. The book is however published by an American publisher so has been written using American English for most of the spellings. The code is exactly the same (many programming languages are created using American English, although in some cases Python can be either British or American spellings). Other than a few words spelt differently in the text this is suitable for anyone speaking any variant of English.
Please view the copyright information regarding use of the circuits.