Making my very own Nintendo Game Boy game has been a dream of mine for a long time, since I was a kid, really.

Galaxika is a 2D shoot-em-up game developed for the Nintendo Game Boy, written in C using the GBDK development kit. The game features 8 levels, 4 types of enemies and 2 bosses.

The alien insect Void Empire has harvested countless star systems, yours is next. Command the lone starfighter Galaxika-1 through 8 treacherous sectors, dodging asteroid fields, blasting enemy drones, and facing their colossal fleet. Can you reach the Void Queen’s mothership before civilization falls?

Galaxika I spent about a week designing the game’s logo and artwork, trying to find a retro style.

I expected the hardest part would be writing code that runs fast on the limited CPU. However, I found that to be pretty manageable. At the end of the day, most game logic is pretty alike in both old and new games, with a main loop that updates your game state, input handling, entity updates/collisions, and finally rendering.

If you try to update everything every frame, or use too complicated math on the little 4.19 MHz CPU, you will feel the Game Boy churn, slow down and drop frames. Just be smart about how much you update and when.

My girlfriend proudly beating the first level of Galaxika on her nth try.

The hardest part turned out to be resource management. You can load 255 sprites into the Game Boy’s VRAM, but it only holds 40 8x8 pixel sprites in its memory at a time. Ideally, you’ll want 16x16 pixel sprites for a good looking game.

A 16x16 sprite is made up of 4 8x8 sprites, so moving those around, animating them together, etc. becomes a bit of a hassle to manage. Everything you load into VRAM has to be carefully planned out when to use and draw on-screen. I ended up writing a sprite pool manager that would only load the sprites from VRAM I needed at that moment, and invalidate them once they were gone, freeing up space for others.

Galaxika I still do pen & paper for game design, to-do lists, works fine.

The game is just about ready, I just need to do some final testing and polish, and some of the levels/enemy waves are pretty hard to beat. After that I’ll tidy up the code a bit and release it as open source. :)