Snake
๐ Snake AI
A classic Snake game featuring a modern JavaScript implementation. It includes both a manual gameplay mode and an advanced AI bot (using BFS & Flood Fill algorithms) to control the snake.
Features
- Dual Modes: Manual player control (WASD/Arrows) and an autonomous AI-controlled mode.
- Advanced Bot: Utilizes the Breadth-First Search (BFS) algorithm to locate food quickly and Flood Fill to avoid getting trapped.
- Score & High Score: Tracks your current score and persists your high score using the browser's
localStorage. - Sound Effects: Simple audio cues for eating and Game Over states (powered by the Web Audio API).
How to Play
- Open the game in your browser.
- Select a mode:
- Click
PLAY GAMEto play manually (PLAYER mode). - Click
WATCH BOTto watch the AI play (BOT mode).
- Click
- Controls (PLAYER mode):
- Use Arrow keys or WASD to move.
Tech Stack
- HTML5 Canvas
- Vanilla JavaScript (no external libraries)
- Web Audio API for sound effects
| Updated | 9 days ago |
| Status | Released |
| Platforms | HTML5 |
| Author | SAMI RAUTANEN |

Leave a comment
Log in with itch.io to leave a comment.