Sunday, December 11, 2005

Canvas Quest - a canvas based RPG

I'm working on a simple Rogelike RPG called Canvas Quest. Here's the first demo.
I've discovered a nice technique for speeding up the rendering of a complicated canvas element which also has animation. For this game, I just draw the tiles 1x time by dynamically creating a orphan canvas element via js. It never needs to be "attached" to the document, because I just want it for its capabilites to render an image that I can then use in the main drawing loop. It was a 10x fold increase in rendering time for me. Anyway, check it out - you can use the arrow keys to move around.

AddThis Social Bookmark Button

2 Comments:

At 4:58 AM, Anonymous g. said...

Very sweet. I'm toying around with canvas in my sparetime myself, but this looks very promising.
It doesn't work with webkit-browsers (yet?) -but it sure is speed optimized with firefox eating all my cicles as soon as I open the URL ;-)

 
At 9:46 AM, Blogger Andrew said...

Gosh you are right! This is very much like writing a videogame. I had no idea that the update loop would have that effect. I posted an updated version with the draw loop pausing when nothing is happening.

 

Post a Comment

<< Home

Loading...