A browser game lives or dies in the first forty seconds. Nobody installs anything, nobody reads a tutorial, and there is no second act to win them back. So when I built SledRun, almost all of the engineering time went into a single question: does steering feel like a sled, or does it feel like moving a cursor?
This is a write-up of the parts that actually mattered — the physics configuration, the fixed timestep, terrain sampling, collision honesty, and the payload budget. It is not a tutorial, and there are no libraries to install. It is what I would tell someone about to build the same thing.
The whole game is six numbers per mode
The site has three playable runs and one engine. Each run is a configuration object, and these are the actual values:
Home (/) | Snow Road (/snow-road) | 3D Sledding (/3d-sledding) | |
|---|---|---|---|
| road width | 12 | 3.2 | 14 |
| base speed | 14 | 20 | 18 |
| max speed | 34 | 30 | 40 |
| steering | 8 | 18 | 6 |
| gravity | 20 | 20 | 9.8 |
| jump velocity | 8 | 8 | 8 |
Five of those six rows are ordinary tuning. Two of them are the reason the runs feel different at all.
Road width. The narrow track is 3.2 units wide against 12 on the homepage. That is not "a bit tighter" — it is a different game. At 3.2 units the walls are close enough that you read the track as a corridor, so a mistake is visible one second before it happens. At 12 units you read it as a field, and the mistakes arrive without warning.
Gravity. The downhill mode runs at 9.8 against 20 everywhere else. Halving gravity does more for the "sliding, not falling" feeling than any amount of camera shake, because the arc of a jump becomes long and shallow instead of a quick hop. It also makes the combo counter fair: a gate you clear at 0.9g gives you enough airtime to actually see the landing.
Steering is lateral speed, not rotation
The first version rotated the sled toward the input direction and let velocity follow. It felt awful — precise, responsive, and completely wrong. A sled does not turn on a coin; it slides, and the slide takes time to build and time to shed.
The version that shipped moves the sled laterally at a rate scaled by steering, and lets the visual yaw lag behind that motion. Concretely, the homepage uses 8, the narrow track 18, the downhill 6. The narrow track needs a high number because you are correcting constantly in a small space; the downhill needs a low number because at 40 units per second a high steering rate turns the whole run into a twitch reflex.
The visible yaw being slower than the actual lateral movement is the trick that sells it. Your eyes see the sled still rotating while the position has already committed. That mismatch reads as weight.
If you take one thing from this post: decouple the visual facing from the movement vector, and make the visual side slower. It costs four lines and buys the entire sense of inertia.
Fixed timestep, because phones are not desktops
The simulation runs on a fixed 1/60 step with an accumulator:
accumulator += delta; while (accumulator >= 1 / 60) { step(1 / 60); accumulator -= 1 / 60; } This is not novel, and that is the point. With a variable timestep, the same input produces different distances depending on framerate, so a jump that clears a rock on a desktop clips it on a mid-range phone. On a game where the failure state is "you hit a tree", that difference is not cosmetic — it is a bug report you cannot reproduce.
The cost is that a slow frame now runs two or three steps in a row, which can spiral. I cap the loop and let the simulation drop time rather than accumulate debt. Dropping simulation time is visible as a stutter; accumulating it is visible as the game going into slow motion and then teleporting. The stutter is the better failure.
The terrain is data, not geometry
Collision does not use raycasts against the mesh. The terrain is a height field, and the game samples height at a position:
heightAt(x, z) -> y Two consequences worth knowing before you build your own:
- The visual mesh and the collision surface can drift apart, and when they do, players notice immediately. "I was above the ground and it still killed me" is the most common complaint in this genre. The fix is not more resolution on the mesh; it is making the mesh read from the same function the physics reads from, so drift is impossible by construction.
- Rails and guardrails have to be part of the sample, not decoration. If the wall is a separate mesh, the player will find the seam. Here the road edge is a smoothstep on the same height function, so the "wall" is a slope, not a collider.
The visual side is instanced: ridges and trees are drawn as instances rather than one draw call per object, which is what lets a scene with a few hundred props stay inside a frame budget on integrated graphics.
If it looks like a tree, it has to stop you
This sounds obvious and is the hardest thing to hold onto when you are late in a build. Every object in this genre is a promise. A tree that does not collide teaches players to ignore trees; once they ignore trees, every near miss stops being tense, and the game becomes a screensaver with a score.
So the rule I enforced: an object either collides or does not exist. Nothing decorative is placed in the play corridor. The trade-off is a sparser track than the art direction wanted, and it is the right trade.
The camera is a difficulty dial
The camera sits behind and above, and it is not a neutral observer. Raising it shows more of the track and makes the game easier; lowering it makes speed feel higher and the game harder. The homepage runs a slightly higher camera than the downhill page, because the homepage is where a first-time player arrives and the downhill page is where someone who already understands the controls goes to be punished.
On mobile the camera also has to survive a rotation. Rotating the device mid-run re-derives the viewport and keeps the current run; losing a run to an orientation change is the kind of thing that gets an app closed and never reopened.
Touch input is not a keyboard
The desktop version reads key state. The mobile version reads a pointer position and steers toward it, with the same steering constant, so neither input is a cheat code. What differs is the dead zone: on touch, a small horizontal movement should do nothing, or every thumb jitter becomes a correction. On keyboard, a key press should be immediate, or the game feels laggy.
Both feed the same state machine, which means pause, resume and restart behave identically. Anything that only exists on one input path is a bug waiting for a support email.
The budget I actually had to hit
Numbers from the final build, measured locally on the same output that was deployed:
- Total download for the homepage: 660 KB
- Shared JS chunk: 195 KB gzipped
- Largest Contentful Paint: 775 ms (local Lighthouse)
- Lighthouse performance, median of three runs: 94
- Cumulative Layout Shift: 0.016
That budget shaped the architecture more than any visual decision. The page is a static Astro build; the 3D scene is a separate chunk that loads after the page is interactive. There is no React, no game engine, and no framework at the page layer. That means the page works — text, links, metadata — before the WebGL scene exists, which matters when the connection is bad.
3D assets are served from object storage on a versioned path with explicit MIME types. That last part is not a detail: a GLB served as application/octet-stream will fail to load in some browsers, and a JS chunk with the wrong content type is blocked outright by nosniff. Serving assets from a CDN without checking content types is how you ship a permanently loading screen.
The rider model is about 2.6k triangles and the home terrain about 4.6k. Low-poly is not a stylistic compromise here; it is what keeps the whole scene inside a mobile GPU's budget while still reading as a 3D world.
What I would do differently
Two things.
Build the leaderboard before the launch, not after. The game stores best score and a local top 10 in localStorage, per mode, and that is genuinely enough for a first release. But every single person who plays asks where the online board is. Local scores answer "did I improve", not "am I good".
Measure on a cheap Android earlier. Everything above was measured on a desktop and a mid-range phone. The number I cannot give you is frame rate on the low end, because I have not measured it — and I would rather say that than quote a number I did not take.
Try it
The game is at sledrun.app. Three runs, keyboard or touch, no account, no ads, nothing loading in the first seconds except the game.
One note that belongs in any post about this genre: it is an original implementation, and the site carries a plain statement that it is not affiliated with the games it shares a genre with. That is a low bar, and it is worth clearing explicitly.
If you are building something similar and want to argue about steering constants, I am interested — the 8 / 18 / 6 spread took longer to find than the rendering did.

