The Accessible Dungeon of Doom

Share this article

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.

James EdwardsJames Edwards
View Author

James is a freelance web developer based in the UK, specialising in JavaScript application development and building accessible websites. With more than a decade's professional experience, he is a published author, a frequent blogger and speaker, and an outspoken advocate of standards-based development.

Share this article
Read Next
Get the freshest news and resources for developers, designers and digital creators in your inbox each week
Loading form