By Martin / The Lab, JavaScript / Friday August 1st, 2008 / No comments
Isn't the <canvas> element wonderful? In this experiment, I made a small snake game, with five speeds. You can view it at http://lab.aspektas.com/canvas_snake.html.
The script is actually adapted from a snake game I wrote for the TI-89 calculators in TI-BASIC, which is why the method may seem a bit... unusual.
Feel free to use the code, but attribution would be nice.
Oh and by the way, this game only works in canvas-supporting browsers, i.e. not Internet Explorer. There also may be bugs in non-Firefox browsers.
∎
I hope you enjoyed reading this article. If you wish, you may view some of the other recent or popular things I have written, or subscribe to receive RSS updates. You can also add a comment, or share this article on Twitter or Facebook, below.
Website copyright © Aspektas 2009 - 2010 Valid XHTML 1.0 Strict and CSS 2.1