Skip to content

herstand/snake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snake Game

  • The game board will fill whatever size document it is loaded within-this would allow it to be easily embedded in an iframe.
  • The snake starts at the center, moving right.
  • The game can be paused/played with the spacebar.
  • As a handicap (for viewability as much as gameplay), the apple has a 5 pixel radius—the snake will eat it if it hits anywhere within this radius.
  • The snake is one pixel thick.
  • The snake dies when it hits a wall or itself.
  • The game restarts automatically when the snake dies

TODO

  • Add a high score (number of apples eaten)
  • Make the thickness of the snake a user-defined feature
  • Add accelerometer events and/or touch-screen buttons for phones/tablets.
  • Have game always run at 60fps (currently depends on difficulty, with max of 100fps) and use requestAnimationFrame instead of setInterval

About

An HTML5 canvas implementation of the classic snake game

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published