Park the Cart

A 3D browser game: park a shopping cart with one bad wheel without scratching the cars. Hand-written cart physics and WebGL 2, replays that are bit-identical across browsers, and a bot that proves every level can be finished.

Landing: "3 wheels work, the fourth is free" over the car park
Overview

Park the Cart (Estacione o Carrinho) is a free, open source 3D browser game, in English and Portuguese, on desktop and phone: push a shopping cart with one bad wheel across a crowded supermarket car park and into the corral without scratching the cars. Every scratch goes on the receipt, each level has a card limit that starts at R$ 4,000 and ends at R$ 100, and the result is a receipt like "R$ 3,480 of damage in 41 seconds". There are ten levels, a daily level that is the same for everyone, five carts and replays you can share as a link. The game is a pure function of the level, the cart and the player's inputs. There is no physics engine: the cart is a rigid body on four wheels in about 200 lines, with fixed rear wheels that cancel sideways slip, swivelling front casters and one faulty caster that alternates stuck and rolling phases drawn from the level's seed. Since nobody can feel a slider in a test suite, the feel is pinned by measurements (drift per second, top speed, coasting and braking distance, sliding in the rain) and a property test checks that no cart ever gains energy without input. A replay link is only the inputs, run-length encoded as varints in base64url, so the same inputs must give the same run in every browser: a fixed 120 Hz step and quantised inputs handle most of it, and because Math.sin, cos and atan2 differ between V8, SpiderMonkey and JavaScriptCore, the core has its own trig built only from exactly rounded operations, with an ESLint rule that bans the others, Math.random and the clock in the core. An end-to-end test plays a messy 40-second run in Chromium, Firefox and WebKit and checks that the final state is bit-identical to Node's. A parking bot plans a path with A* on a 25 cm grid around everything that can bill, then drives the real simulation with a steering and speed controller, waiting for gaps in moving traffic. Levels are generated from a spec and a seed and kept only if the bot parks them with R$ 0 of damage; the bot's run ships as the level's par, CI replays forty bot runs across the carts, and the daily level re-rolls until the bot can finish it, so over 2,000 simulated days every one was finishable. The car park is 3D without a 3D library: about 2,300 lines of WebGL 2 written for the game, with cars, carts, cones and kerbs built in code from the same sizes the collisions use, painted asphalt, one low sun with a shadow map that falls through the baskets' wire mesh, and a flat top-down renderer as the fallback. The matrices, camera and models are plain functions unit tested in Node, and the bundle is held under a 200 KB budget.

Highlights
Hand-written cart model with no physics engine: fixed rear wheels, swivelling casters and one faulty wheel, with the feel pinned by measurements and a no-free-energy property test
Deterministic core with its own trig built from exactly rounded operations, so a 40-second run ends bit-identical in Chromium, Firefox, WebKit and Node
Replays shared as a link: run-length-encoded inputs as varints in base64url, parsed strictly as untrusted input and fuzzed with fast-check
A parking bot with A* and a driving controller proves every level finishable; CI replays forty bot runs, and the daily level re-rolls until the bot parks it
3D without a 3D library: about 2,300 lines of WebGL 2, models built in code from the collision sizes, a shadow map and a flat renderer as fallback
Ten levels, a daily level, five carts, English and Portuguese, desktop and phone, under a 200 KB bundle budget
Technologies
TypeScriptWebGL 2CanvasViteVitestProperty-based testingPlaywrightGitHub Actions

Hiring a senior full-stack engineer? Let's talk.