A classic Snake Game built using HTML, CSS, and Vanilla JavaScript.
The game features dynamic grid generation, score tracking, timer functionality, food spawning mechanics, and keyboard controls.
- Dynamic game grid generation
- Real-time score tracking
- Built-in game timer
- Random food spawning
- Keyboard controls
- Collision detection
- Game over handling
- Responsive playground sizing
- Clean and minimal UI
- HTML5
- CSS3
- JavaScript (ES6)
- Open the game in your browser.
- Use the arrow keys to control the snake:
| Key | Action |
|---|---|
| ⬆️ | Move Up |
| ⬇️ | Move Down |
| ⬅️ | Move Left |
| ➡️ | Move Right |
- Eat the red food blocks to increase your score.
- Avoid hitting the walls.
- The game ends when the snake collides with the boundary.
Snake-Game/
│
├── index.html
├── style.css
├── script.js
└── images
git clone https://github.com/your-username/snake-game.gitSimply open index.html in your browser.
No additional setup is required.
- Pause / Resume functionality
- Restart button
- High score system
- Mobile touch controls
- Sound effects
- Difficulty levels
- Snake self-collision detection
- Local storage for score persistence
- Dark / Light themes
Contributions, issues, and feature requests are welcome.
Feel free to fork this repository and submit a pull request.
Created by Anshu Kharwar
GitHub: https://github.com/anshu-Creates
If you like this project, please give it a ⭐ on GitHub.
