A modern, feature-rich Snake game implemented in HTML5 Canvas and JavaScript. Control the snake using arrow keys, collect food to grow longer, and try to achieve the highest score possible!
- Smooth, responsive snake movement
- Beautiful day-to-night transition as the snake grows
- Animated moon phases and star field
- Multiple fruit types with different point values
- Dynamic soundtrack with various melodies
- Sound effects for all game actions
- High score persistence using localStorage
- Modern UI with clean, attractive design
- Auto-collision avoidance system (luck feature)
- Tail-cutting survival mechanic
- Responsive design for all screen sizes
- Open
index.html
in your web browser - Use arrow keys to start the game and control the snake's direction
- Collect fruits to grow longer and increase your score
- Avoid hitting the walls or the snake's own body
- Try to beat your high score!
- The snake speeds up as it eats fruits, making the game progressively more challenging
- The background gradually shifts from day to night as the snake grows
- Each fruit has a different point value: Apple (10), Banana (15), Orange (20), Strawberry (25)
- The "luck" feature gives your snake an 80% chance to auto-avoid collisions
- When the snake hits itself, there's a 50% chance it will cut off its tail to survive
- Score is reduced proportionally when the snake cuts its tail
- Press the opposite direction key to temporarily slow down the snake
- ↑ Arrow Up: Move up
- ↓ Arrow Down: Move down
- ← Arrow Left: Move left
- → Arrow Right: Move right
- Space: Start game / Pause game
- S: Toggle sound effects
- M: Toggle background music
- N: Change to a different music track
- L: Toggle luck feature (collision avoidance)
- V: Toggle snake vibration effect
- When the snake grows, its skin becomes darker
- The moon phase reflects the actual astronomical day, not gameplay time
- You can slow down the snake by pressing the arrow key opposite to current direction
- Each fruit has a different score value - strawberries are worth the most!
- The luck feature helps your snake avoid collisions automatically 80% of the time
- If you hit yourself, there's a 50% chance your snake will cut its tail to survive
- The more segments you lose when cutting your tail, the more points you'll lose
- Use the tail-cutting feature strategically to escape tight situations
- Clone this repository or download the files
- Open
index.html
in your web browser - No additional setup required!
The game is built using:
- HTML5 Canvas for rendering
- Vanilla JavaScript for game logic
- CSS3 for styling
- Web Audio API for sound generation
- LocalStorage for high score persistence
This project is open source and available under the MIT License.
© Peter Adrianov, 2025. All rights reserved.