The Accessible Dungeon of Doom

Today sees the official launch of The Art & Science of JavaScript, our awesome new JavaScript book, to which I contributed a chapter all about the technique I developed for building a first-person perspective maze with CSS and JavaScript. A demo of the game is available online (make your way through the maze to win a discount on the sale price!). And the chapter itself has been republished for free as a feature article here on sitepoint.com.

You might recognise it as an offshoot of a script I originally published back in August 2006. But the new version for the book is a big improvement, most notably (as far as I’m concerned) because of the addition of generated text descriptions for the maze, which makes the game playable for users who can’t see the images. Here’s an example:

The corridor stretches 20 meters in front of you, then turns left. On the left wall there's a passage after 4 meters. On the right wall there's a passage after 4 meters.

I have actually played the game in JAWS 7, and it’s totally possible — it’s harder, for sure, because the visual reference cues aren’t there, so you have to remember where you’ve been, effectively holding the map in your mind. But nevertheless it can be done, and I did make it to the end! It seems to me that games are one of the most difficult things to make accessible, because most are inherently visual, so I’m very chuffed even to have got this far. The new version also includes API hooks for adding additional game logic to the basic maze-generating engine.

But you know what, making the game really wasn’t that hard. I just kinda went off on one, and it happened. The tricky part was explaining how it works! Sometimes when I’m developing something I go off into a bit of a trance, and I’m not completely sure what I’m doing, so much as just trying stuff to see what happens. So when it comes to explaining retrospectively what I did, what decisions I made and techniques I used, it’s pretty tough … because I don’t really know. How do you explain something you barely understand yourself? It’s even tougher to make it make sense (but that’s what editors are for).

But eventually it came together into an engaging chapter … even if I do say so myself! It’s a good complement to all the other fascinating and insightful chapters in the book, and I’m extremely pleased and proud to have been a part of it.

And it has lots of pictures.

Win an Annual Membership to Learnable,

SitePoint's Learning Platform

  • pauldwaite

    The tricky part was explaining how it works

    Yup. To really learn something, you have to teach it, and that’s hard.

  • http://www.dotcomwebdev.com chris ward

    lol masochist. nice work man :)