Vanilla JavaScript Snake game on HTML5 canvas
I coded this game to practice my JavaScript skills.
My goal was to implement some functionality from
nostalgic
Nokia 'Snake' game.
Present functionality:
Attention: page will reload when resizing window and you will loose your game.
- Move, eat, grow(after finished digesting), die on collision.
- Track score, record, length, speed.
- Food: mice and rabbits. Rabbits show up and disappear randomly.
- Fenced and free world modes.
- Settings (sound, grid visibility, fence, saving).
- Save to local storage.
- Control with keyboard (arrows or VIM (h,j,k,l) ) and touch controls for mobile.
Attribution:
↑
←
→
↓
score 600
record 2000
length 2000
speed 2000
Press ENTER to start