● S4 WebGPU wasm32

Orbit

The physics pillar's acceptance test, wearing a rocket costume. Launch, climb through the air, reach an orbit, and warp along it a thousand times faster than it happens.

orbit — crcbl
Starting…
Click the canvas first. A canvas has to hold keyboard focus to receive keys, and browsers will not start audio until you have interacted with the page. Clicking away pauses the game and lets go of whatever key was held — no platform sends the release for a key that was down when focus left.
Touch reaches the engine. A contact arrives as an ordinary pointer, and the first one is also the gesture a browser waits for before it will start audio. Whether this demo can be played with one is in its controls below — not all of them can. Switching tabs pauses the game and lets go of whatever was held: no platform sends the release for an input that was down when focus left.

controls

It is already flying. Press anything and it is yours.

what is actually running

Two ways of moving a spacecraft, and the rule that switches between them.

While the engine is burning or the ship is in the air, the flight is integrated: gravity that falls off as the inverse square, quadratic drag against an atmosphere whose density falls off exponentially with altitude, and thrust against a mass that drops as the tank empties — stepped four times per tick by a symplectic integrator. Terminal velocity on the way down is not scripted anywhere; it is where the drag comes to balance the weight.

Coasting in vacuum with the engine shut down, it is solved instead. The ship's position at some time ahead is the answer to Kepler's equation, which costs the same to ask for a second away as for a century — so a tick at ×1000 advances a thousand seconds without integrating a thousand times, and without the drift a thousand times the steps would accumulate. Ten thousand revolutions later the ship arrives within a centimetre of where it started, which is a test in the repository rather than a claim on a page.

The switch between them is the whole point, and it is a rule rather than a button: the analytic solution is only the truth while gravity is the only force, so opening the throttle or touching the top of the atmosphere drops the warp back to ×1 on the same tick. Try warping on the pad and the controls will refuse you.

The orbit drawn on the map is not an ellipse fitted to the ship. It is the same propagator asked where the ship will be at ninety-six times spread evenly across one period, stroked as a single closed curve through its own answers — which is why the samples crowd together at the far end of an eccentric orbit and spread out as it swings past the planet.

Open the console for the engine's log. The wasm module imports nothing, not even console.log, so log lines are queued inside wasm and drained by the page each frame. crcbl.audio(), crcbl.saves() and crcbl.logLevel(4) are there too.