/Snake

Implementation of the classic arcade game Snake.

Primary LanguageJavaScript

Snake

Demo

Run the game locally.

  1. Start a local server to serve index.html. If you are using Python 3 you can run python -m http.server.
  2. Open your browser and navigate to localhost:8000.
  3. Play!

Next steps.

  1. Handle the following edge cases:
    • The provided canvas and scale combination can only fit one cell.
    • The scale doesn't divide evenly into dimensions.
  2. Use images to represent the snake and the apple.
  3. Show a counter that keeps track of the snake length.
  4. Optimize the function for getting a random available coordinate.
  5. Add the ability to pause.
  6. Animate the snake movement more smoothly.
  7. Paint the boundaries of the game area.