Pixel Rogue

I whipped this up the other day as something to do in my down time. It’s an ultra-minimal roguelike based off of my cave generator. There’s little real objective, just travel as far as you can through the dungeon, killing enemies. No items or stats, although I suppose things of that nature could be added later.

Arrow keys move and attack, and the view can be zoomed with the appropriate buttons.  The player is the green pixel, enemies are yellow, the exit staircase is red, and the entrance staircase is blue (although it’s not usable).  Killing an enemy replenishes one health point. As you progress down the dungeon, enemies will get larger health pools, and more will be spawned, making it harder to progress.

The enemies randomly move until the catch sight of the player (determined by a modified version of Bresenham’s line algorithm) and then follows using an A* pathfinding method (where diagonal movement is strongly discouraged).

Some issues:

  • There is a chance that no enemies will be spawned on a level.
  • Since it uses the cave generator code, it sometimes places the exit very close to the entrance.
  • It’s not a very deep game.  Some more things should be added in.
  • There seems to be something wrong with the line of sight algorithm, since enemies will sometimes not be able to see you when they definitely should.
  • I would like to implement a field of view for the player (so that you can’t see the whole map) to add a bit more challenge.  This isn’t hard to implement, but since there’s something wrong with my line of sight code, it doesn’t come out quite right.

The game can be played here, and the source is downloadable here.

Comments are closed.