Thursday, April 23, 2009

An RPG in JavaScript

I've spent my train time for the last two weeks working on an wrting an JavaScript RPG (Thats Role Playing Game) system. The end result is intended to be a cross between the system used by Kingdom of Loathing and a traditional text adventure.

So far I've been boged down with a lot of low level mechanics, and ensuring that all my objects can round trip between JavaScript and XML. E4X makes this far less painful then it would otherwise be. The plan is to have a JavaScript game engine that executes XML based adventure files. Why XML? because JavaScript can allready parse it and it will be less cryptic then JSON. I'm musing that an adventure creator would also be nice, and would give me an excuse to play with XUL.

E4X means that at the moment my engine will only run in Firefox. But then this is a hobby project and I have better things to do then deal with the Pandora's Box of cross browser issues. Especially as Firefox 3 already implements so many goodies from HTML5 and ECMAScript 5th Edition.

Though I can't wait for the next beta of Firefox 3.5 and the @font-face CSS property. That and border images Should really come in handy when I get around to putting an interface page together.