https://github.com/bborbe/snake
https://github.com/bborbe/snake
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/bborbe/snake
- Owner: bborbe
- Created: 2025-12-25T21:43:36.000Z (5 months ago)
- Default Branch: master
- Last Pushed: 2025-12-25T21:44:34.000Z (5 months ago)
- Last Synced: 2025-12-27T08:13:27.181Z (5 months ago)
- Language: HTML
- Size: 4.88 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Snake
Classic Snake game implemented in vanilla JavaScript.
**Play online:** https://bborbe.github.io/snake/
## Features
- Smooth snake movement
- Progressive speed increase
- Speed boost with spacebar
- High score tracking
- Pause functionality
- Collision detection
## How to Play
Open `index.html` in browser.
### Controls
- `←` `→` `↑` `↓` - Change direction
- `Space` - Speed boost
- `P`/`Esc` - Pause
- `R` - Restart
## Gameplay
- Eat red food to grow and score points
- Game speeds up every 50 points
- Avoid hitting walls or yourself
- Use speed boost for precise movements
### Scoring
- Each food: 10 points
- Speed level: score ÷ 50 + 1
## Technical
- Pure JavaScript (no dependencies)
- LocalStorage for high score persistence
- Modular architecture (GameState, Renderer, InputHandler)
- 30×30 grid, 20px cells
- Dynamic speed scaling