A pure front-end Snake game built with TypeScript and Canvas, bundled with Vite.
- Keyboard controls — Arrow keys or WASD to move, Space to pause/resume
- Mobile support — On-screen D-pad for touch devices
- Auto speed-up — Snake accelerates every 5 food items
- High score — Persisted in
localStorage - Visual polish — Gradient snake body, snake eyes, food glow, pause overlay
npm install
npm run devOpen the URL shown by Vite (default http://localhost:5173).
npm run build
npm run preview| Key | Action |
|---|---|
| ↑ / W | Move up |
| ↓ / S | Move down |
| ← / A | Move left |
| → / D | Move right |
| Space | Pause / Resume |
On mobile, use the on-screen directional buttons.
- TypeScript — Game logic and rendering
- Canvas 2D — Graphics
- Vite — Dev server and bundler
- Zero runtime dependencies