In August of last year (2023) I started classes again at my local community college that were part of their Programming for Electronic Gaming course. Intro to Game Development was one of the classes I took. The main focus of the class was learning how to program using Python and a module called Pygame to create games. The first project we were given that actually included using graphics, animation, and collision was to create a version of Pong. One of the newer concepts that we were also learning was how to create modules to load into a python program and how to create classes that can be used to create multiple instances of an object such as multiple Paddles. Sound Fx, drawing the game surface, adding animations, and player controls were handled using Pygame. When I created the initial game I built the paddle and the ball as their own classes in their own modules, this was done more as a way to get familiar with importing modules and creating custom modules. In the current beta version I pulled everything into the same python file so I could refactor the code easier and then determine later if I would benefit from moving parts into separate modules. I plan on creating modules for any of the python code I write that I might be able to use for other projects.
In this series I’ll be detailing all of the programming that was involved, the order in which the game runs so that everything updates correctly after each frame, and how all the objects in the game are tracked and how they interact with each other with collision and how each power up works. My goal is to finish this game so that I can post it for anyone else looking to get started in programming games using python. From the simple version I went on to update the images using some simple drawings I made using aseprite to creating additional classes for adding power ups to the game. The Shield which spawns the bricks that protect the player, the sword which spawns a second paddle for the player to hit back with, and the clock which gives the player a speed boost. I also made it so when the max score between the two players increases their paddles will shrink and every time the max score is a multiple of 5 an additional ball is served to move the game along faster as the game goes on. The next post I’ll go over the code that I wrote to make this game one part at a time and make it available to download once I finish the series. The conclusion of this project will be a fully documented arcade game that will be playable in the Games section of my website.