Modern Snake Game
A classic Snake game implemented using HTML, CSS, and JavaScript. The game runs directly in your browser, offering a simple and nostalgic experience. Control the snake using the keyboard and grow it by eating food while avoiding collisions.
Features
Core Gameplay
- Smooth snake movement with edge wrapping
- Progressive difficulty (snake speeds up as you eat)
- Score tracking and high score persistence
- Bonus food system with special points
Controls
- Movement: WASD keys or Arrow keys
- Game Control: Space bar (Start/Pause/Resume)
- Sound: M key (Mute/Unmute)
Visual Features
- Modern gradient background
- Realistic snake graphics with body segments
- Particle effects when collecting food
- Achievement notifications
- Clean, modern UI with game info panel
Sound System
- Food collection sound effects
- Bonus food sounds
- Game over sound
- Mutable audio
Additional Features
- High score system with local storage
- Achievement system
- Pause/Resume functionality
- Responsive design
- Game over detection
- Bonus food mechanics
How to Play
- Press Space to start the game
- Use WASD or Arrow keys to control the snake
- Collect regular food (white) to grow and increase score
- Watch for bonus food (golden) for extra points
- Avoid colliding with yourself
- Press Space to pause/resume
- Press M to toggle sound
Technical Details
- Built with vanilla JavaScript
- Uses HTML5 Canvas for rendering
- Local storage for high score persistence
- Modern CSS with flexbox layout
- Responsive design principles
Installation
- Clone the repository
- Open
snake-game.htmlin a modern web browser - No additional dependencies required
Browser Compatibility
- Chrome (recommended)
- Firefox
- Safari
- Edge
Future Improvements
- Mobile touch controls
- Multiple difficulty levels
- Power-ups system
- Multiplayer mode
- Custom themes
Credits
- Sound effects from WebDevSimplified
- Developed by Neaj Morshad
License
This game is open source and free to use. Feel free to modify, enhance, or share it with others.
Enjoy the game!
On this page
Languages
HTML56.0%JavaScript31.0%CSS13.0%
Contributors
Created September 16, 2024
Updated December 6, 2024