Yinsh   Rez Advance   Oil Painter

I wrote this game for a Gameboy Advance Programming Competition running at the University of Waterloo in March 2005. The game is based off the PS2 game Rez, which is shooter in the loosest sense of the genre. I went from having never developed for the gameboy advance to the finished product in 2 weeks. To gain the most from this experience, I avoided the use of any libraries and tried to use as many of the hardware features of the GBA.

In order to play a GBA rom, you will need an emulator. I suggest using the Visual Boy Advance emulator, as it is open source and available for a variety of platforms.


The game visuals and mechanics center around the game music. The foundation of the program is a 4-channel audio mixer. Three channels are devoted for background music, mixing different samples to create the techno beat. The fourth channel is used for sound effects. All the visuals, mechanics and even the sound effects are in sync with the background music.

The Gameboy Advance does not have a hardware mixer, so a software mixer needed to be implemented. Originally 4 channels were chosen since the processor is rather slow, however with the current load used by the game, the GBA should have no problems with an 8 channel, or possibly 16 channel mixer. To make things easier, all the background music samples are of the same length, so they will align properly. Sound effects are also sized relative to the background music so they will be equivalent to 16th and 8th note lengths. Sound effects will only play on the 16th or 8th note beat of the music so they are always synchronised to the rhythm of the music.

The background visuals use a simple repeating animation to make it look like the player is floating into a vortex. A palette shift is used to have the background pulse with the beat of the music. Enemies (the giant yellow balls, I'm not much of an artist) will fly at you from the center of the vortex. The enemies cannot damage the player, however they will shoot missiles at the player which do cause damage.

Since the design is based around everything syncing up with the music, the player cannot kill an enemy at any time. To accomplish this, instead of directly firing at enemies, the player has a targeter which will mark enemies to be killed, up to 4 things can be targeted at once. Once targeted, the player can then choose to kill them, with their deaths, and accompanying visual and audio effects being all synchronized with the music.

Scoring is based on number of enemies and missiles destroyed. Enemies are worth more points than missiles, enticing the player to not simply target missiles in hopes of self preservation. The more objects that are being targeted when destroyed will have a multiplying effect on the score for those kills.

Source Code
Rez Advance was written in C++ using the VisualHAM IDE (however it does not use the HAM SDK). Due to the limited time to develop this project, the code is not particulary well organized. All the primary functionality is in the main.cpp file, and there is a large amount of code duplication among functions doing similar operations (but on slightly different data). The main game loop is in one rather large function and the use of global variables is quite ugly. The code has been untouched since its submission to the competition, but some day I will hopefully get around to cleaning it up.