How to play
You fly a small helicopter through a cave that never ends. The cave scrolls from right to left and you have a single control. Hold it and the helicopter climbs; let go and it drops. Stay clear of the rock above and below, and of the orange blocks that sometimes hang in the middle of the tunnel. After you press Start the helicopter hovers and the game waits. The flight begins with your first press.
Your score is the distance flown in metres. The cave slowly gets narrower and the scroll speed slowly rises, so every run becomes harder the longer it lasts. Easy, Normal and Hard change how wide the cave is, how fast it moves and how often blocks appear. Your best distance for each mode is kept in your browser and is never sent anywhere.
Controls
- Keyboard: hold Space, ↑ or W to climb. P or Esc pauses and resumes. Enter or Space presses the button that has focus.
- Mouse: hold the left button anywhere on the playfield.
- Touch: touch and hold a finger anywhere on the playfield.
- Full screen: the Full screen button or F shows the game on the whole screen.
- The game pauses by itself when you switch to another tab. After a crash the buttons ignore key presses for 0.7 seconds, so holding a key through the crash does not restart the game by accident.
How it works
Motion under constant acceleration
The helicopter moves up and down under a constant acceleration. Gravity pulls it down all the time. While you hold the button the rotor adds a bigger push upward, so the net acceleration points up. When you let go, only gravity is left. On the scale of the playfield (10 pixels = 1 metre) gravity is 240 m/s² and the net push while you hold is 336 m/s² upward. Between two changes of the button the acceleration a does not change, and the textbook formulas apply:
v = v0 + a · t
y = y0 + v0 · t + ½ · a · t²
Here v0 and y0 are the speed and height at the moment you pressed or released, and t is the time since then. From full falling speed, a press stops the fall in 14 / 336 = 0.042 seconds, after only 0.3 metres. From full climbing speed, letting go stops the climb in 14 / 240 = 0.058 seconds, after 0.4 metres. To stay level you hold for about 240 / 576 = 42 percent of the time, because then the average acceleration is zero. The game advances in fixed steps of 1/120 second using exactly these formulas, so the flight is the same on a slow screen and on a fast one.
A speed limit
A falling object in air stops speeding up when drag balances its weight; this is called terminal velocity. The game imitates it with a simple clamp: the vertical speed can never exceed 14 m/s up or down. At the limit the curve turns into a straight line, so a long hold is a steady climb and crossing the whole 48 m high playfield takes at least 3.4 seconds.
Building the cave
Each cave is made by a seeded random walk. A pseudo-random generator started from a number called a seed gives the same cave for the same seed, and a new seed gives a new cave. The cave is a list of control points, about 0.85 seconds of flight apart. At every point the centre of the tunnel moves up or down by a random step, and the points are joined with a cosine curve whose slope is zero at each point, so the walls are smooth. The width of the tunnel shrinks with distance until it reaches a minimum.
The step size is capped so that following the centre line never needs more than about two thirds of the top vertical speed, even on Hard: the steepest step is 5 m in 0.85 seconds, and the cosine curve is steepest in its middle at π/2 × 5 / 0.85 = 9.2 m/s. That keeps the tunnel passable. Blocks are only placed at the flat points of the curve, and only if the free space above and below them is at least 7.8 metres high, so the narrowest parts of the cave have no blocks.
Tips
- To hover, tap in a steady rhythm and keep each press a little shorter than each pause.
- Look ahead of the helicopter, not at it. The cave bends smoothly, so start turning before the wall does.
- Stay near the middle, where you have room to correct a mistake.
- At a block, choose the wider gap early and move there while the cave is still straight.
- Short presses give short hops. A press of a tenth of a second lifts the helicopter by only about 1.6 metres.
- Practise on Easy first.
Frequently asked questions
Does the helicopter keep rising after I let go?
Only for about 0.06 seconds and 0.4 metres. Gravity first has to cancel the upward speed, then the helicopter drops.
Is every cave different?
Yes. Each flight uses a new random seed.
Does the cave ever end?
No. The tunnel stops narrowing and the speed stops rising at fixed limits, and from there the cave goes on until you crash.
Does it work on a phone?
Yes. Hold a finger on the cave to climb; the page does not scroll while you play.