/jssnake

Primary LanguageJavaScript

JavaScript Snake

Classic snake game with few improvements.

I have added settings to the game:

  • Check if snake goes out of game board. If checkbox is set game will end, otherwise it will continue
  • Check if snake collides with itself. If checkbox is set game will end, otherwise it will continue
  • Cell num (per each dimension)
  • Interval
  • Canvas size

Settings are save in web storage.

Game is implemented in vanilla JS without using any framework or webpack. package.json is used only for eslint

Demo

https://sigmaray.github.io/jssnake/

How to play

  • Pause/unpause: p key
  • Move: left/right/up/down keys
  • Restart: ctrl+r or f5

Todo

  • Move CSS from style attributes into separate file
  • Rewrite game in C++/QT

Screenshot

image