/Snake.js

HTML5 Canvas Snake

Primary LanguageJavaScriptBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Snake.js

An HTML5 Snake game I wrote to learn how to use <canvas>

Play it here!

Controls

  • spacebar - start or retstart the game.
  • p key - pause the game.
  • w or up arrow - turn the snake up.
  • a or left arrow - turn the snake left.
  • d or right arrow - turn the snake right.
  • s or down arrow - turn the snake down.

Note:

This is a port of a game I wrote in Processing. I apologize if the code is a little funky in some places. It should work pretty well though... let me know if it doesn't. Play it on my server and see how it compares to the Processing version here