Skip to content

Latest commit

 

History

History
15 lines (13 loc) · 847 Bytes

README.md

File metadata and controls

15 lines (13 loc) · 847 Bytes

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