Earlier chapters look out from the bike — at the wave it floats on, the probes it
reads, the curve a tuck rides. This one looks at the bike. A short tour of what's
actually under the orange paint: the hull, the four hover probes, the PD spring that
holds it up, the arcade thrust + steer model that pushes it around — and the variants
that share every line of that code.
Anatomy of a hoverbike
The shipping bike is almost embarrassingly simple. The physics body is a
capsule — 0.6 m long, 0.45 m radius — wrapped in a stylized hull and a
rider block for the visuals. Hanging off that capsule at runtime are four hover
probes, one at each corner of the footprint. Bow and stern (the yellow ones)
read fore/aft slope and become pitch; port and starboard (the cyan ones) read side
slope and become roll. That's the whole vehicle, from the sim's point of view.
Behaviour comes from a flat little stats block — mass, hover height, top speed, accel,
turn torque, a couple of damping coefficients. Swap the numbers and you get a new
bike. The lineup ships with five archetypes that share every line of code and differ
only in those numbers: Racer (the baseline), Cruiser
(heavy, fast, sluggish), Stunt (light, agile, banky),
Scout (heaviest, soft hover spring, punishing wave-pump timing), and
Sparrow (lightest, stiff spring, forgiving launch).
Pick a flavor below to recolor the bike and see its real stats. Toggle the hover probes
and the physics capsule to see the parts the renderer normally hides.
Live demo — anatomy. Drag to orbit, scroll to zoom. Stats are read
straight out of src/game/bikes/variants.ts.
The hover spring
A hoverbike that just clamps to a constant height looks like a magnet on a
fridge — too stiff for an arcade racer. So lift is a PD controller
(proportional + derivative) in acceleration units, applied vertically every fixed step:
The P term (hoverSpring) is a spring: how hard the bike
pushes back when it's off its target height. The D term
(hoverDamp) is a shock absorber: it bleeds vertical speed so a hard
landing doesn't pogo. The + g cancels gravity at rest, so the spring's
equilibrium is exactly at the target height instead of sagging below it.
The default tune (spring 34, damp 8.5) puts the system at a damping ratio of about
ζ ≈ 0.73 — comfortably underdamped, so the bike settles with a single soft bounce
rather than creeping in. Crank the spring with the damping fixed and the bike turns
twitchy; zero the damping and you'll watch the bike sproing for half a minute. Both
failure modes are one slider away.
Live demo — drop a bike and watch the spring settle. The plot is height vs time; the
yellow ring is the target.
Why a PD at all? Because the sea is moving. A constant-height clamp
would force the bike to teleport with every crest; a spring lets it lag and roll —
which is precisely the feel that makes wave-mastery a skill. The same controller runs
four times per tick (one per probe) so the bike doesn't just settle to a height, it
settles to a pose.
Drive and steer
With lift handled, drive boils down to two impulses per tick: a forward thrust and a
yaw torque. Forward thrust is just throttle · accel · speedFalloff, where
speedFalloff is a linear ramp that goes to zero as you approach
topSpeed. That's the whole "the bike has a top speed" mechanic — no hard
clamp, just thrust that tapers to nothing. Boost and the tuck-bonus and the drift
mini-turbo all multiply the cap upward, so they push you past base top-speed by giving
speedFalloff more room to run.
Yaw is a torque too: steer · turnTorque. The bike has angular damping
built into its rigid body so the yaw doesn't keep spinning forever after you release
the stick. What stops the bike from skating sideways through every corner is
lateral drag — a force opposite the bike's right-vector component of
velocity, scaled by lateralDrag. Drop it and the bike turns into a hover
puck; raise it and it carves on rails.
Drag the joystick (or use WASD) and try all five archetype stats. The
Cruiser is the heaviest in the lineup; its low turnTorque means the
chassis is committed to a line. The Stunt and Sparrow turn so sharply they almost
pirouette — that's their turnTorque at 5.0 / 5.5 and their light mass
buying them angular acceleration. The Scout's soft hover spring isn't on this demo
(it's flat ground here) but its low accel + low turn-torque is — it reads as a tank.
Live demo — drive. Pick a variant or hand-tune the stats. The simulation is the same
arcade thrust + lateral-drag model from hover.ts.
What's not on this page
Three big bike-feel systems live in their own chapters and aren't repeated here:
Chapter 02 — Hover & Buoyancy shows the four
probes in motion, sampling the wave field and turning the height
differences into pitch + roll.
Chapter 03 — Tuning the Feel walks the tuck
sweet-spot curve — the snowboarder-duck input that's hidden inside the dive
gesture.
Chapter 04 — The Drift covers the Mario-Kart-style
mini-turbo: charge tiers, the inside-vs-outside drift styles, and how the boost
stacks with everything else.
Read the code
The bike entity itself is a thin file:
src/game/entities/bike.ts. Stats and the five variants are in
stats.ts and
variants.ts. All the real behaviour — hover spring, slope momentum,
climb assist, dive kick, lateral drag, drift bias — lives in one (large) module:
src/game/systems/hover.ts. The demos on this page import the same
stats the shipping game uses, so the numbers you're dragging are the numbers under
the bike when you race.