How it's built
- Fixed-timestep simulation at 60 updates per second, rendered with requestAnimationFrame
- Spatial hash grid: segments and pellets are bucketed into cells so collision checks only look nearby, keeping thousands of checks fast
- Smooth body physics: each segment follows the one ahead at a fixed distance, with turn-rate limits on the head
- AI snakes probe ahead in a fan of directions to avoid bodies and walls, seek the best-value food, and sometimes hunt the player
- Camera with smooth follow and dynamic zoom, view culling, glowing pellets with additive blending
- Live leaderboard and minimap, Pointer Events for mouse and touch, high-DPI canvas scaling
- No libraries, no frameworks, no build step
← Back home