Build log · Games
How I built Carlson
A three.js parkour speedrun with Quake-style air strafing, wall runs and a grappling hook

1.Why I built it
I wanted a fast first-person movement game on the desktop, the kind where the fun is in carrying speed through a level rather than in the shooting. Carlson is late for his performance review, and every floor of the office is a white tiled test chamber with a timer running.
The first version shipped with five levels of grid-tiled rooms, neon door frames, jump pads, kicker ramps, lasers and a grappling hook. A later update added harder floors with moving lasers, stepping stones over pits, grapple chasms and Auditors that lead their shots.
2.How it works
A movement sim with no renderer in it
All player movement lives in sim.ts as pure functions over plain objects, so I could test it headlessly. The model is Quake-style: ground acceleration toward a wish direction with friction, and an air acceleration step whose wish speed is capped at 1.4. That small cap is what makes air strafing work, because turning while holding a strafe key keeps adding speed perpendicular to your velocity.
Collision is axis-aligned boxes. The player is an AABB with a 0.35 m half-width that is 1.7 m tall standing and 0.9 m crouched. I move along x, then z, then y, and each axis either moves freely, steps up onto a ledge lower than 0.45 m, or snaps flush against the face it hit. The game runs the sim at a fixed 1/120 s step with an accumulator, so a jump goes the same height at any frame rate.
Slides, wall runs and ramps
Crouching above 5 m/s turns into a slide. It adds a one-off 3.2 m/s boost with a one-second cooldown and drops friction to 0.55, and on a ramp gravity is projected along the slope so sliding downhill speeds you up. While grounded on a ramp, vertical velocity is set to forward speed times the slope, so running up a kicker throws you off the lip without any special launch code.
A wall run starts when you are airborne, pushing forward and moving more than 4 m/s along z next to a wall. Gravity drops to a fifth and fall speed is clamped, and the run ends after 1.6 seconds. You cannot chain two runs on the same side without landing first. A wall jump pushes you 7 m/s away from the wall. The grapple pulls you toward its anchor with an acceleration proportional to the remaining distance, plus a little lift so you leave the floor.
Levels built from segments
Each level is a straight chain of rooms along +z, written as a list of segment types: office, gap, ramp, wallrun, lasers, grapple, islands, sweep, arena and so on. A builder walks the list, keeps a running floor height so rooms can rise and fall, and emits boxes, ramps, kill volumes, jump pads, props, hint zones and bot spawns, each room joined by a framed doorway. Moving lasers are boxes that oscillate along one axis as amp * sin(2πt / period + phase).
Every level also carries an aggro multiplier for the Auditors, and gold, silver and bronze times. Best times are saved in localStorage and checked against those thresholds when you reach the exit pad.
The tile look is one shader
The tiled walls and floors use no textures. A custom GLSL fragment shader picks the plane each face lies in from its world-space normal, then draws a thin dark line every metre using fract and fwidth, which keeps the lines crisp at any distance. The same shader adds a fixed directional light, a tiny per-tile brightness hash, a faint sheen on floor tiles and exponential distance fog.
The neon door trims, light panels and hazard strips are separate emissive materials. The office props (cabinets, desks, plants, coolers, fridges) are small groups of boxes built in code.
Auditors that aim ahead of you
An Auditor first checks line of sight with a ray from its eye to yours, out to 34 m. If it can see you it turns toward you on a smoothed yaw, and its eye swells for the last 0.35 s before it fires so you get a warning. On harder floors the shot speed scales with the square root of aggro, and the bot aims at part of where you will be when the shot arrives, based on your current velocity.
Your staple gun is a hitscan ray tested against bot boxes and the level geometry. A miss leaves a small staple mark and some sparks on the wall. The exit only opens once every Auditor on the floor is down.
3.Try it
WASD to move, mouse to look, Space to jump (hold to hop), Shift or C to slide, click to staple, right-click or E to grapple, R to restart.


