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
- Mouse: move the pointer and the ring glides to the point under it. The pointer is never captured. Hold either mouse button to brake.
- Touch: drag anywhere on the view. The ring follows your finger’s movement, 1.5 times as far, so your thumb never hides it. Hold the BRAKE button to slow down. Turn the phone sideways or use Full screen for a bigger view.
- Keyboard: the arrow keys or W, A, S, D move the ring. A short tap nudges it, holding reaches 5.4 m/s within 0.25 s, and it stops about 0.05 s after you let go. Space brakes, P or Esc pauses, F switches full screen and M the sound.
- Brake: slows you to 55 % of the normal speed for up to 1.6 s. After a short pause the meter refills in about 7 s.
- Difficulty: Easy starts at 79 km/h and rises toward 151 km/h, Normal goes from 101 toward 202 km/h and Hard from 130 toward 259 km/h, with smaller openings and faster bars.
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:
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.
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
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
- Watch the dashed circle as much as the ring: it shows where you will meet the next obstacle.
- Move early and in one smooth motion. A small correction near the obstacle is easier than a big one.
- For spinning bars, choose the gap that will be in front of you when you arrive, not the one you see now.
- Head for the centre of an iris as soon as it appears. It reaches its final size about 20 m before you.
- Save the brake for fast stretches where two obstacles come close together.
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.