Star Fighter

Personal

Project Type

Python, Pygame

Languages/Frameworks

Programmer, 2D Artist

Role(s)

May 8, 2021

Latest Release

Star Fighter is a 2D shoot ‘em up which takes inspiration from 80s arcade games like Galaga and Defender, as well as modern titles like ZeroRanger. In the game, the player controls the titular Star Fighter and is tasked with gaining as much score as possible by shooting the endless torrent of enemies and avoiding projectiles.

I wrote the game in Python using the pygame framework. In addition, I designed and animated the pixel art assets. Save for the music, which was composed by a friend, I developed the game by myself to learn Python and game development.

In Detail

Star Fighter is the first game that I released publicly. Up until then, I’ve been developing games using pygame and other game engines rather aimlessly. After deciding to settle down with pygame as I felt that full-fledged game engines such as Unity were overwhelming, I hunkered down for a couple of weeks to learn everything I can about it.

The first version of the game is essentially just a clone of a KidsCanCode tutorial but dressed with my own art assets. It’s rather lackluster, in retrospect, but I was proud of finally finishing a game.

Star Fighter - First VersionStar Fighter - First Version

I released the game on itch.io as Version 1 and left it at that. I participated in a few game jams over the following months before deciding to come back and review Star Fighter to see what else I could improve upon. Back then, I didn’t know better, so I set about adding every cool feature I could think of and within a week, I ended up with such a mess of a codebase that adding new features became exponentially time-consuming and tedious. It got so bad that I eventually decided to take a step back and re-evaluate.

Luckily, around the same time, I was attending my university lectures and the topic that week was coincidentally about design patterns. After researching more and learning about them - particularly the State pattern - I set about to rewrite the entire codebase from scratch but this time with the appropriate design patterns in mind.

It took over a month to rework the entire game, and I meant reworking not just the codebase but the ‘creative’ side, as well. In fact, I’d guesstimate that 70% of the time was spent redesigning the gameplay and the art assets, which now featured animations. The resulting game was substantially more complex than the previous version on all fronts.

Star Fighter Intro ScreenStar Fighter Gameplay

I continued to update the game for a couple of months, which mostly consists of minor graphical enhancements. Eventually, I wanted to move on to other projects and so called it quits. Before that though, I decided to open-source the codebase to give back to the community as I “borrowed” and studied other open-source codebases during development, and I definitely wouldn’t have been able to solve a number of problems without them.

Looking back, there’s still a number of glaring game design and code issues present. Not making the ‘triple gun’ powerup not expire is rather silly, for example, and it was made as a bandaid for the game’s exponentially increasing difficulty. There’s also some code choices I made that seem rather bizarre in retrospect - the UI code for one is rather messy and I went about loading the animation frames in a brute-force manner.

And that’s all she wrote. Well, perhaps there’s a bit more. Star Fighter is a project that I’m really fond of as it unified all of my interests - games, art, and programming. It was also the subject of a write-up in two issues on Linux Format (#282 and #283), and seeing my name on print is cool! But more importantly, it was also the project in which I received my first fan mail, talking about how much they enjoyed my game, and that is really cool!

Anyways, if you enjoyed this write-up, I’d like you to know that I’m currently developing a spiritual successor to Star Fighter called Glass Wing. No details yet, but stay tuned!

Posted on Tue Apr 16 2024