Phaser 4TypeScriptVerlet physicsDeterministic simulationWeb AudioVitest
Керування
- Hold anywhere (or Space or the up arrow) to pull the line in: the kite climbs and the line pulls harder; let go and the line pays out under the kite's pull
- Drag left or right while holding, or use the left and right arrows, to steer; a quick flick up tugs the kite into a short pop
- Double-tap and hold, or hold the down arrow, to lock the reel and keep the height
- Fly slowly near a courier bird so it can land, then fly over the dovecote roost and tap Release (or press Enter); Land reels the kite home
- Watch the bamboo tension meter: let go before it bends to the red mark or the line snaps; a fluttering pennant warns of a gust
- P or Escape pauses; assists (steady wind, wide catch, auto-release, snap guard) and a left-handed layout are in Settings
- Add ?demo=3 to the address to watch the reference run of flight 3
Needs WebGL. Without it the poster is shown. Respects the reduced-motion setting: the camera follows without overshoot and zooms in steps, wind streaks are fewer and slower, grass bending and screen shake are off, tags and screens fade instead of popping and swinging; the kite and line still fly the same. Sound is off until you turn it on. Progress saves in this browser.
Питання
How do I play Kite Line?
Hold anywhere to pull the line in and climb, let go to pay line out, and drag left or right to steer. Fly slowly near a courier bird so it lands, then release it over the roost.
Why does the line snap?
The line has real tension. Let go before the bamboo tension meter bends to the red mark; a fluttering pennant warns of a gust.
Does it work on a phone?
Yes, it is played with one hand, and a left-handed layout is in Settings. Space and the arrow keys work on a keyboard.
How many levels are there?
Forty-five hand-designed flights in five chapters, with eight kites to buy with Feathers. Progress saves in this browser.
Як це зроблено
A one-hand kite-flying game. You fly kites from the chalk cliffs above Gullhaven, an invented seaside town where the post travels by courier bird. Tired birds come in from the sea and land on a kite that passes close and slowly enough; you carry them down to the dovecote on the big roof and let them go. Hold to pull the line in, let go to give it line, drag to steer, flick up to pop the kite, double-tap and hold to lock the reel.
How it's built
- Rules apart from drawing.
core/ is plain TypeScript with no Phaser import: the line, the kite, the wind field, the birds, the fixed-step flight simulation, the 45 flights, the economy, the profile and the save. It is covered by Vitest tests, and the same simulation runs in the browser and in the tests. - A real line. The line is a Verlet rope of 36 points (24 on the low tier) with distance constraints that only pull, so it can go slack and sag. The kite is held by a taut-line limit: it can never be further from the reel than the line is long, and how far that limit has to move it each step is the line tension the meter shows. A shaping pass bows the rope like a light catenary, so a taut line still curves a little and a slack one droops. Reeling has inertia: the spool speeds up and slows down instead of jumping.
- A kite that trims itself. Lift and drag come from a flat-plate model (lift coefficient 2 sin a cos a, drag 2 sin² a) with a stall above about 69°. The bridle holds the sail at a fixed angle to the line rather than to the wind, which is what makes a single-line kite stable: high in the wind window the angle of attack shrinks and the kite stops climbing, low down it grows and the kite pulls up. On a slack line the bridle lets go and the kite weathervanes into a shallow glide. Steering shifts the bridle angle and adds a small sideways pull that fades at the edges of the window. The tail is a short chain with heavy drag.
- Wind you can see. The wind field is deterministic from the flight's seed: a base wind that wanders, gust fronts and lulls that sweep in from upwind as bands (with a warning before they arrive), thermal columns over the warm roofs, rotor eddies behind the cliff edge, the church spire and the lighthouse, and in storm flights gusts that swing the wind up and down. The scene samples the same field to move the white streaks, bend the grass, fill the wind sock and draw the fronts and the thermal shimmer.
- Fixed steps, same result every time. The simulation runs at 120 Hz with an accumulator capped at four steps per frame, and the scene draws interpolated positions. Two runs with the same inputs give the same state hash.
- Every flight is tested. Each of the 45 flights (five chapters of eight plus a festival) is played in a Vitest test by a scripted reference run with the starter kite and no upgrades; it must earn at least two stars. The two-star and three-star scores were set from those runs. The same script drives
?demo=<n> and the card capture. - An economy checked by a test. Feathers come from new stars (30, 70 and 70) and deliveries (in full the first time, half on replays). A test plays the campaign as a two-star and a three-star player and checks they can afford about two thirds and nearly all of the shop: seven kites, line, reel, spare spar and basket upgrades. Cosmetics are earned from stars, letters, festivals and the daily streak, never bought.
- Painted in code. The coast (sea, beach, lighthouse, town with its spire and dovecote, chalk cliff, tree and the kite stall) is painted once per time of day into a canvas texture; kites, birds, the line, wind and grass are drawn each frame with Phaser graphics. There are no image files. Eight kite shapes, six bird silhouettes that differ by shape and size (not only colour), and five times of day from morning to lantern-lit dusk.
- Sound is synthesised. Web Audio: wind from filtered noise that follows the wind at the kite, the line's hum as a resonant tone whose pitch rises with tension, sail flaps on a stall, a chirp per bird type, a bell and a crowd at festivals, and an optional plucked tune. Phones vibrate briefly when a bird lands and before a snap.
- Accessible and calm when asked. The interface is real DOM over the canvas with headings, buttons and a tension meter; a live region announces gusts, landings, deliveries, tension and the result. Under reduced motion the camera follows without overshoot and zooms in steps, there is no shake, the streaks are fewer and slower, and screens fade instead of swinging in on a string.
- Performance. Rope points, constraint iterations and wind streaks follow the quality tier, the device pixel ratio is capped at 2, and the game sleeps when the tab is hidden or the page is scrolled away (a live flight pauses).