BP.IO / POST

Guardian

 

Guardian is a game I have been working on in my spare time over the last couple of months I built in 2010. This post is now in the wrong tense … :)

I won’t go into the nasty details, but the game is implemented using a bunch of concepts & tools including: haxe, javascript, websockets (see this), neko, client-side prediction, rpc, ajax, mysql, jquery, and @font-face. All things I was unfamiliar with 6 months ago.

Guardian is my foray into the world of web coding and it was a fun learning experience. I submitted the game yesterday to a competition run by Mozilla. The competition exists to stimulate the development of games that use the latest built-in features of browsers — and don’t require external plugins, such as flash player.

I’m not going to release the source code, as it’s quite messy and I don’t have the time to clean it up and document it. If you are interested in knowing how a particular part of the game works, let me know, and I’d be happy to write something about it.

The game was programmed using a language called HaXe. The benefit of using Haxe over straight javascript is that I could use the same language for both the code that runs in your browser (the client-side), and the code that runs on the server. Haxe compiles (or translates, depending on opinion) to other languages, such as javascript, flash, c++, php, and neko. The source for Guardian is almost 100% haxe. This is then translated to javascript for the client and Neko for the server-side. Haxe also comes with a useful networking library for neko, which drastically simplifies development of multiplayer games.

Now that I’ve finished the first iteration, I’ve got to get back to working on my thesis…