Neat demo! I like that you've chosen to code this from scratch rather than use an engine. I'm writing in Javascript myself at present.