HTML5 Snake 2.0 (global high score)

New game url:

Finally, game has the global high score 😉


  • global high score – it shows 17 highest scores
  • keyboard more shortcuts – p to pause/resume a game and r to restart the game (and of course – arrows, w/s/a/d)
  • improved security/validation during typing the name
  • game was tested in Chrome 12, IE 9, Firefox 5
  • I used FirePHP to debug and to resolve problems in PHP code, really good tool 🙂
Known issue:
  • during the game it is possible (randomly) that snake will go out of board (down and right side). Probably there is a problem with redrawing or refreshing and function in snake.js:
    Snake.prototype.isOutOfBoard = function () {
        return this.position.x < 0 || this.position.x > 600
            || this.position.y < 0 || this.position.y > 600;

    I don’t know why it is happen, if someone know why issue appears, please let me know 🙂

Source code:
  • source code of the game (all files) you can find there.

One thought on “HTML5 Snake 2.0 (global high score)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s