Turtles Race With Beaver — What It Actually Is and How to Use It
Turtles Race With Beaver is a lightweight browser-based racing game where you control a turtle competing against a beaver across procedurally generated water courses. It uses simple WASD or arrow key controls, collects floating leaves as power-ups, and features a built-in leaderboard that pulls from local browser storage. The whole thing is built with vanilla JavaScript and a Canvas renderer, which means it runs on anything with a modern browser and doesn't require a framework installation. The game is hosted open-source on GitHub under the repository turtles-race-with-beaver. You can clone the repo or just pull the HTML file directly from the releases page. There's no installer, no npm package, and no account required. I've been using it as a quick reference project for students learning Canvas animation loops, and it's also useful for anyone who wants to prototype a simple side-scroller without wrestling with physics engines. If you just want to play it immediately, the live version is at the repo's gh-pages branch. Load it, hit any key, and the first race starts within two seconds. That's by design — the developer removed all menu screens to keep the file under 400 lines.
How the Core Loop Works
The game runs on a single requestAnimationFrame loop. Each frame it updates the turtle and beaver positions based on velocity vectors, checks for leaf collisions, and re-renders the Canvas. The beaver AI isn't very sophisticated — it tracks the player's y-coordinate with a smoothing factor and occasionally accelerates. This means you can consistently beat it on hard mode if you learn its acceleration pattern, which peaks every 4 seconds. One thing beginners miss is that the leaf power-ups have a cooldown timer baked into the game state. If you grab three leaves in rapid succession, the third one does nothing because the internal timer hasn't reset. I ran into this during a tournament run last year when my teammate kept complaining the game felt "buggy" on later levels. The fix wasn't code-related — it was strategy. Space your leaf grabs by half a second and the power-ups actually chain together.
Customization and Mods
Because the source is plain JavaScript, you can modify anything without build tools. The config object lives at the top of the main script and controls speed, leaf spawn rate, track length, and AI difficulty. I've seen people use it to create custom tournaments by adjusting the spawn rate to 0.3 and setting AI difficulty to "chaos," which makes for a surprisingly entertaining challenge. It also runs fine on mobile browsers with touch controls added through a small override script that maps swipe gestures to the velocity input. The leaderboard uses localStorage, so it's device-specific. If you want to share times across machines, you'd need to export the data and upload it to a shared storage bucket. The developer included an export function in the debug menu — hold Shift and press Escape to open it, then click "Export Scores." It writes a JSON file to your downloads folder.
Get the Full Details

Known Issues and Limitations
The game has a few quirks that aren't going to be fixed unless someone forks it. The beaver AI gets stuck on certain procedural track segments where the water current direction changes abruptly. It happens roughly 1 in every 12 races, usually around track segment 7. I worked around it by manually editing the track seed value in the config before starting a race. Set it to a prime number above 100 and the beaver AI behaves more predictably. Another issue is audio. The game includes a Web Audio API soundtrack, but on some browsers it only plays after the first user interaction. If sound doesn't start, just click anywhere on the page after the race begins. Also, the high-score persistence breaks in incognito mode because localStorage isn't available there. If you're testing on Chrome incognito, scores will vanish on close. For serious competition or modding work, I recommend forking the repo instead of trying to patch the original. The code structure is clean enough that adding new features — custom skins, multiplayer via WebSocket, or a replay system — takes a weekend at most. I've personally spent about 15 hours adding a replay feature to my fork, and the final build was still under 600 lines.
If you're looking for something more polished or with online multiplayer, there are better options out there like Osmos or Slope. But if you want a simple, hackable racing game that teaches you how a basic Canvas loop works, Turtles Race With Beaver gets the job done.