A classic Snake game built with HTML5 Canvas, CSS, and JavaScript. Play on both desktop and mobile devices!
- Cross-Platform: Works on desktop and mobile browsers
- Responsive Design: Automatically adapts to different screen sizes
- High Score Tracking: Saves your best score locally
- Wall Teleportation: Pass through walls to appear on the opposite side
- Smooth Gameplay: 150ms game loop for optimal speed
- Use Arrow Keys or WASD to control the snake
- Press any key to start the game
- Tap the game canvas to start
- Swipe in any direction on the canvas to control the snake
- Swipe up โ Snake moves up
- Swipe down โ Snake moves down
- Swipe left โ Snake moves left
- Swipe right โ Snake moves right
- ๐ Eat the red food to grow and score points (+10 points each)
- ๐ Pass through walls to teleport to the other side
- ๐ Don't hit yourself or the game ends
- ๐ Beat your high score!
๐ฎ Play Now - No download required!
- Download or clone this repository
- Open
snake.htmlin any modern web browser - Start playing!
No installation or setup required - just open and play!
- File:
snake.html(single file game) - Technologies: HTML5 Canvas, CSS3, Vanilla JavaScript
- Canvas Size: 400x400 pixels (20x20 grid)
- Mobile Support: Touch events and swipe gestures
- Storage: LocalStorage for high score persistence
Works on all modern browsers including:
- Chrome, Firefox, Safari, Edge
- Mobile browsers (iOS Safari, Chrome Mobile, etc.)
Enjoy the game! ๐ฎ