Neat-O-Droid

This small 2D game took about two weeks from start to finish.

As a cleaning bot, you are assigned the task of cleaning up the space station. Evil litter bots are making life difficult, but you can disable them by firing collected junk pieces at them.

The look is somewhat inspired by the good old Paradroid C64 game, with some Pacman mechanics sprinkled in (gobble up the pellets, avoid and kill the monsters, clear the maze).

Play the game in any desktop browser by clicking on the image below:

click on the image to open the game in a new window – webgl-enabled browser required!

The most interesting programming challenge was the map generator– I spent the bigger part of the first week on it. The levels in the game are fairly small, but the algorithm can generate arbitrarily big maps. The general structure is a nested set of rectangular rooms and hallways, such as this:

a bigger maze

The algorithm is based on a simple binary space partitioning scheme, essentially going through these steps:

  • Divide an initial rectangle with a few wide separators (the hallways).
  • Recursively divide the parts with thinner separators (rooms separated by walls).
  • Identify all separator spans shared by two rooms (potential doors).
  • Create a random path covering all rooms (this will be the set of required doors).
  • Randomly delete a subset of the remaining doors.

This way, all rooms are guaranteed to be reachable with an adjustable overall amount of doors.

Game design lesson: With the number of moving parts, the parameters that have to be balanced explodes. Even in a simple game as this, tweaking things like

  • size and complexity of the map
  • amount of initially distributed junk
  • player speed and fire rate
  • enemy speed and “litter rate”
  • rate of enemies respawning
  • speed of “junk unloading” at the chute
  • number of junk items the player can carry

do not only make the difference between easy and hard, but also change how the game needs to be played to win.