Clever Quest Lab ← Games

Tunnel Flight

Your score is the distance flown, kept for each difficulty, and braking costs you time, not metres.

0 mDistance
–Best
0 km/hSpeed
Brake

Tunnel Flight

Steer the ring through every opening: move the mouse, drag a finger or use the arrow keys.

Difficulty

The ring is your craft. The small dashed circle shows where it will meet the next obstacle: keep it inside the opening.

Mouse: move to steer, hold a button to brake · Keyboard: ←↑→↓ or WASD steer, Space brake · P / Esc pause · F full screen · M sound

Runs on your device. Nothing you type or record is uploaded. Keeps working without a connection while the page is open. Works with touch. Saves your best distance for each difficulty, the chosen difficulty and the sound setting on this device.

Added

How to play

Tunnel Flight is an endless flight down a curving tube. The bright ring with four short ticks is your craft. It moves anywhere inside the round cross-section of the tunnel while the tunnel carries you forward, so you only ever steer up, down, left and right. Obstacles drift out of the haze ahead: walls with a single round hole, spinning bars, irises that close as you approach, and rows of sliding blocks. Fly through the open part of each one. A single touch ends the run.

The distance you flew is your score, and the best distance for each difficulty stays in this browser. Speed rises slowly from the start, openings shrink a little and obstacles come closer together, so every run begins gently and gets harder the farther you get. A label marks every 1,000 m.

The small dashed circle on the next obstacle is your ring projected onto it. If that circle sits completely inside the opening, you will pass as long as you hold your position.

Controls

How it works

The tunnel is a chain of rings 4 m apart around a smooth centre line made of a few sine waves, and its radius is 4 m. Every point is first moved into the camera’s own frame, with x to the right, y up and z straight ahead, and then projected onto the screen:

xscreen = f · x / z     yscreen = f · y / z

Here f is the focal length in pixels, chosen so that the view is never wider than 100°. The camera looks along the tunnel and sits halfway between the tunnel’s axis and your craft. The view swings when you steer, yet the ring still travels across the screen and ends up under the mouse pointer.

The hit test happens in the flat cross-section, at the moment the middle of an obstacle reaches your craft. It uses your position p = (x, y) and a hit radius r of 0.28 m. The drawn ring is a little larger, so a graze that only touches its outline does not count.

wall: |p − c| ≤ a − r     bar: |−sin θ · x + cos θ · y| ≥ w + r

Here c and a are the centre and radius of the hole, θ = θ0 + ωt is the angle of a bar and w = 0.4 m is its half-width. The iris is a regular octagon checked edge by edge, and each block is a square. The speed follows

v(d) = v0 + (v1 − v0) · (1 − e−d/L)

where d is the distance flown and L is 2.4 to 2.8 km. To keep every run fair, each new opening or free spot is placed no farther from the previous one than the keyboard speed allows: |Δp| ≤ 5.4 m/s · (Δt − 0.45 s), where Δt is the time between the two obstacles without braking.

Tips

Frequently asked questions

Why did I crash although the ring looked inside the hole?

The check happens when the middle of the obstacle reaches the ring. Before that, a distant obstacle looks small next to the ring because of perspective. The dashed circle on the obstacle shows the true comparison at every moment.

Does braking lower my score?

No. Only distance counts, so braking costs time, not metres.

Is every run different?

Yes. The bends of the tunnel and the obstacles are generated anew for each run from a random seed.