Project Summary

This was a summer project I used to familiarize myself with the Python 3.6.8/3.7 programming language and the Pycharm development environment. My objective was to create a Space Invaders clone game using the turtle module in python, which believe I managed to do pretty well. There are a lot of online tutorials for recreating these old arcade games, but most only reproduce very simple clones, so as a challenge I worked to make my clone much more comprehensive.

Design Summary

As I said, this project was intended to get me up to speed with the python programming language, so I didn't necessarily approach this project with any overarching organization in mind. Principally I just sought out to functionalize as much of my code as possible to try and achieve some semblance of a degree of object oriented programming. There are functions for pretty much every aspect of the game from drawing the menu and the game itself, initializing the turtle objects, projectile behavior, etc.

The basic operation of the program begins with the menu screen being drawn, with a function monitoring for either of two difficulty options to be selected. Once an option is selected, the difficulty setting function clears the screen, calls the initialization function, calls the game drawing function, and calls the mainloop function. Within the mainloop are statements and conditions for invader movement, projectile movement, hit detection, and scoring. The mainloop also calls some animation functions, the scoring functions, and the game over function, which returns the player to the menu.

The program utilizes the OS method for reading and writing the score files, and the turtle method for all animation.

As far as obvious problems with the project that were aparent during the design process, I over relied on global variables as I didn't yet have a solid understanding of how global and local variables work in python, differing from the first programming languages I had learned in high school, like Java, VB, etc. Any future work I do on this project will include transitioning away from global variables and instead passing objects between functions.

Results

Overall the whole project came together pretty nicely. The game plays more or less the same as the original game, minus the motherships, extra lives, and screen size. Visually the game doesn't leave too much to be desired either, lacking the animation and the different invader typ es present in the original. The lack of different models is the result of some time restraints I had as the semester began, otherwise I would've painstakingly recreated each sprite. Instead, my models come from Christian Thompson's blog, where he make's a much less robust space invaders clone. You can visit his blog here.

I still have quite a bit more work I'd like to do on this project aside from cleaning up the code. First off as soon as I have the time I plan on using Py Installer to create an executable file for Linux operating systems, like Ubuntu, on which I created this game. Eventually a windows version is also planned, both of which will be available for download here. Another planned version is for browsers, using a python to javascript interpreter like Brython, so I can showcase the game right here.

In the meantime, you can see the not totally finished game on GitHub, here.