Home / Python On Github

A Sense of Humor

I don't have much in my Python portfolio, I typically use Python for quick image manipulation scripts or for text manipulation. But this one turned out to be one of my favorite projects. After my friend roped me into doing a game jam with him, I ended up writing all of the code for a rhythm game from the ground up using Pygame. The rhythm game was the result of a great idea a friend of ours had where the concept was that you were a medieval doctor balancing the humors of your patients. We uploaded the game to positive reception. You can play the version we uploaded to the game jam here, although it is incomplete and always renders to 1920x1080, so you may have to adjust your display settings.

I continued to develop the game until the others stopped working on it. The game recalculates the notes' positions after each frame according to the position of the music, so they never fall out of sync. After discovering that Pygame included no utilities for GUI rendering, I built my own on top of Pygame called layout. This is not meant to be used for general-purpose reasons, I only built the features that I needed for this project, and I left it open to extension in case I wanted to expand upon it later if I chose to reuse it for a different project. It includes buttons, text boxes (with text wrapping written myself) images, and of course an object hierarchy for determining the behavior of different elements. It uses a callback system for event handling rather than an event queue, which was sufficient for the purposes that the library was originally written to be used for.

A later version of the project that you can play here uses this library to add a main menu and my personal favorite, the track editor. I was hoping that the ability to create and edit new tracks right in the game would make it stand out more, but the placeholder GUI art makes it stand out in an entirely different way.

The below video of the game jam version of the game includes a hiccup at the start where the music playback halted briefly, demonstrating how the notes are kept in sync. This issue occurs when I set a broken speaker as my output device.

Here, I have a video of the newer version linked above. I had to make a copy of the original repo because it was private.