Reason and Madness

The past few months have been challenging, to say the least. Personal events have caused me to reflect and re-evaluate myself and my projects. Dig suffered from a spot of neglect and a lack of direction, until the last several weeks where I have reworked and rebuilt core pieces of it. Torturing it to death and bringing it back to life like some sadistic necromancer.
There is reason behind the madness, however. One thing that really started bothering me was the server-side code being so tightly twisted up with the front-end code. It meant the game relied on a Rails stack and a database, when it would be faster and more portable to have the browser do all the work. So I forked the front-end code out into a new project and focused on getting the game to a playable state without server-side dependency. It was a big broken mess at first, but eventually it all came together, and the game could run without being shackled to a database. All the dungeon generation is now client-side, and I added support for saving dungeon layouts locally in the browser.
So now if you place a torch on a block, it’ll be there the next time the page loads, along with all the other blocks, and the position of the player avatar will be right where you left it. This also meant it was a heck of a lot easier to build in new features, so now you can dig blocks instead of getting stuck in a corner somewhere with no way to get out. Of course if you dig a block with a torch on it, the torch goes away and you’ll be left in the dark. And if you dig a block near a torch, it’ll stop occluding the light, which is a pretty neat effect.
In honor of Halloween, last week’s efforts were put into adding skeletons (well, one skeleton anyway) to the game. The skeleton will spawn in a dark area of the map and wander around until it sees the player avatar, at which point it’ll move toward the player avatar. For now the skeleton doesn’t attack, but that will be my next task.
Mobile support is likely broken, and the stairs don’t work anymore, but give it a go at http://digdeepdungeons.herokuapp.com/.
Arrow keys to move. Move into a block to dig. Press x or spacebar to place a torch. If you get stuck or just want to build a new dungeon, click the RESET button.
There are definitely some bugs. There’s some weirdness with the lights and some areas remain dark that should be lit when blocks are dug out. Also there’s an issue with Chrome where the darkness disappears when a block gets dug. Firefox and Safari seem ok, though. YMMV!









