Cave Flyer & Reaction Distance

Thread a shifting tunnel, plus the physics: flying faster costs you no reaction time at all — it costs you the distance you must see ahead.

Hold space, up arrow or the mouse to thrust upward; let go to thrust down. The marker on the right is how far ahead you need to be looking for the bend that is coming. Change the speed and notice the cave gets gentler — it has to. Nothing is uploaded.

Flying faster costs you no reaction time at all

To cross a vertical gap of dy under acceleration a takes √(2·dy/a) to reach and 2√(dy/a) to arrive level. Neither expression contains your forward speed. What speed changes is how much tunnel that fixed time occupies:

StepTime to reachTime to settle See ahead at 200 px/sSee ahead at 400 px/sSee ahead at 800 px/s
20 px 0.158 s 0.224 s 45 px89 px179 px
40 px 0.224 s 0.316 s 63 px126 px253 px
80 px 0.316 s 0.447 s 89 px179 px358 px
160 px 0.447 s 0.632 s 126 px253 px506 px

An 80-pixel step takes 0.447 seconds to settle on whether you are crawling at 200 or flying at 800. What changes is the 89 pixels of warning you needed against 358. The difficulty knob is the viewport, not the clock.

And levelling off is not free. Arriving level takes exactly √2 times longer than merely arriving — 1.4142 at every gap and every thrust, because both times scale as √dy. You pay forty-one per cent for wanting to stop.

Both times grow as the square root of the gap, so a step four times bigger costs only twice as long — and more thrust helps only as its square root too, which is why quadrupling the engine feels like so little.

Which is why a fast cave has to be a gentler one

Said about the tunnel rather than the pilot: following a centre line y(x) at speed s means a vertical acceleration of y″(x)·s², so a cave is flyable exactly while its curvature stays under a/s². That budget falls as the square of the speed — double the speed and you may follow only a quarter of the curvature.

SpeedCurvature budgetSteepest the caves useBiggest step you see
200 px/s 4.00e-2 1.66e-2 33.5 px
400 px/s 1.00e-2 6.42e-3 20.0 px
800 px/s 2.50e-3 1.49e-3 7.0 px

The last column is what you actually see on screen: the caves above are built from sine waves whose combined curvature is held inside the budget, so the fast one moves 7.0 pixels between slices where the slow one moves 33.5. It is not a design choice — a steeper fast cave would simply be unflyable.

The timings are derived and then flown: the manoeuvre is integrated step by step and it takes the predicted time and lands on the predicted height, within 0.000% at the tabled gaps and at a gap of 113 pixels that the table does not list. Thrust throughout is 1600 px/s².

How to use

  1. Hold space, up arrow or the mouse to thrust upward.
  2. Release to thrust downward — there is no coasting.
  3. The dashed marker is how far ahead you must be looking.
  4. Change the forward speed and watch the cave get gentler.
  5. Press Fly for a new cave.

Frequently asked questions

Does flying faster give you less time to react?

No, and this surprises people. Crossing a vertical gap of dy under acceleration a takes the square root of 2dy/a to reach and twice the square root of dy/a to arrive level. Neither expression mentions your forward speed at all. An 80 pixel step takes 0.447 seconds to settle on whether you are crawling or flying.

Then what does speed actually change?

The distance that fixed time occupies. At 200 pixels per second an 80 pixel step needs 89 pixels of warning; at 800 it needs 358. The difficulty knob in a cave flyer is the viewport rather than the clock — going faster demands you can see further to use the time you already have.

What does it cost to level off rather than just arrive?

Exactly the square root of two, which is about 41 per cent. Arriving level means accelerating half way and decelerating the rest, and the ratio between the two times is 1.4142 at every gap and every thrust because both scale as the square root of the gap.

Why do fast caves look gentler?

Because they have to be. Following a centre line at speed s means a vertical acceleration of the curvature times s squared, so a cave is flyable exactly while its curvature stays under a over s squared. That budget falls as the square of the speed — double the speed and you may follow only a quarter of the curvature.

Does more thrust help much?

Less than you would hope. Both timings scale inversely as the square root of the acceleration, so quadrupling the engine only halves the time to cross a gap. The same square root means a gap four times bigger costs only twice as long.

Are the caves here always flyable?

Yes, by construction. Each one is built from sine waves whose combined curvature is held inside the budget for the chosen speed, and the test suite checks every generated cave against that bound rather than assuming it.

Does this send anything anywhere?

No. Every cave is generated and every flight computed in your browser, and nothing is uploaded.

🔒 This tool runs entirely in your browser. Nothing you enter is uploaded, logged, or stored.