An interactive and feature-rich Snake Game built using HTML, CSS, and JavaScript (Canvas API). The game includes dynamic speed increase, bonus food system, pause/resume functionality, and a persistent leaderboard using browser LocalStorage.
โ Smooth snake movement using JavaScript game loop โ Dynamic difficulty โ game speed increases as score grows โ Golden bonus food that gives extra points โ Pause / Resume functionality using keyboard controls โ Restart system with Game Over screen โ Persistent High Score tracking โ Leaderboard system (Top 5 players saved locally) โ Modern dark UI with responsive layout
- HTML5 Canvas
- CSS3
- JavaScript (ES6)
- Browser LocalStorage
| Key | Action |
|---|---|
| โฌ๏ธ | Move Up |
| โฌ๏ธ | Move Down |
| โฌ ๏ธ | Move Left |
| โก๏ธ | Move Right |
| P | Pause / Resume |
- Normal food โ +1 score
- Every 5 foods โ Speed increases
- After 5 foods โ Golden food appears
- Golden food โ +5 score
- Collision with self โ Game Over
The game stores:
- High Score
- Top 5 player scores
using browser LocalStorage, allowing persistent tracking even after page reload.
Snake-Game/
โ
โโโ index.html
โโโ style.css
โโโ script.js
โโโ README.md
- Clone the repository
git clone https://github.com/NRR385/Basic-Snake-Game.git
- Open
index.htmlin your browser
- Sound effects
- Difficulty levels
- Mobile touch controls
- Online leaderboard (Firebase / Backend)
- AI auto-play snake
โญ If you like this project, consider giving it a star!