There are many similarities in GUI and game program design concepts, code structure and programming techniques. So, the knowledge we gained earlier while coding GUI programs with Tkinter will be an excellent foundation for games creation.
A fully functioning game will typically involve graphics, animation, collision detection, sound effects, music tracks, scoring and handling user input events. Quite a challenge.
Yet, the PyGame module is more than capable of meeting this challenge.
PyGame can draw lines, shapes and surfaces; write text in a large range of fonts and styles; load, manipulate and move images; play sounds, music tracks and videos; consume keyboard, mouse and joystick input events; interact with files, CDROM disks and cameras; and much more.
The official PyGame website has a comprehensive list of module functionality.
In the next series of posts we'll walk through a very simple animation code listing to identify the key building blocks required by any PyGame app. In the process we'll revisit some Python programming techniques and pick up a few new coding skills.
A post from my Learn Python on the Raspberry Pi tutorial.