master
Snake Game
A classic Snake game built with pure HTML, CSS, and JavaScript. No dependencies, no build step — just open and play.
Features
- Smooth grid-based snake movement
- Score tracking with persistent high score (localStorage)
- Keyboard controls (Arrow keys or WASD)
- Game over detection (walls & self-collision)
- Restart button
- Responsive, clean retro-style UI
Project Structure
snake-game/
├── index.html # Main HTML page
├── css/
│ └── style.css # Game styling
├── js/
│ └── game.js # Game logic
└── README.md
How to Play
- Open
index.htmlin any modern web browser. - Use the Arrow keys or WASD to control the snake.
- Eat the red food pellets to grow and earn 10 points each.
- Avoid hitting the walls or your own body.
- Click Restart to start a new game.
Development
No installation required. Simply clone or download the project and open index.html.
If you prefer a local server:
# Python 3
python -m http.server 8000
# Then open http://localhost:8000
License
MIT
Description
A classic Snake game built with HTML, CSS, and JavaScript. Control the snake to eat food, grow longer, and avoid hitting walls or yourself.
28 KiB
Languages
JavaScript
73%
CSS
15.8%
HTML
11.2%