Paper Plane is a game in your browser. A top-floor window, a long hand-drawn world of rooftops, a park, a river and hills. Pull back, aim, let go. After that, the air decides.
Nothing you see in the flight is a drawn curve.
What is under the hood
- The plane is a point with a pitch angle, and 240 times a second three forces push it and one turns it. Lift and drag both come from the angle of attack, the angle between the wing and the air moving past it, and both grow with the square of the speed.
- The stall is real. Past about 13 degrees the model blends from a lifting wing to a flat plate: lift falls away, drag jumps, and the plane drops until it has the speed to fly again. Throw it at the ceiling and it lands at your feet. That is the model, not a rule.
- Pitch has its own equation. The nose is heavy, so the plane keeps turning to meet the air at about 5.5 degrees. Holding the screen raises that by about 4 degrees: the only control in the air. It trims at 6.5 m/s and glides 7.4 metres forward for every metre down.
- The swoop is not scripted. Throw it hard and level and it climbs, slows, noses over, speeds up and climbs again. That trade of height for speed is called a phugoid, and it falls out of the equations on its own.
- The air moves. Wind that is slower near the ground and gusts over time, warm air rising off sunny roofs, cold air sinking over the river, lift where the wind meets a slope, and a cushion of air near the ground. Every force uses the plane's speed through the air, not over the ground.
- One sky a day. The world and its weather come from a seed, and the seed is the date, so everyone flies the same sky and a distance means something. The step is fixed and nothing in flight is random: the same throw into the same sky lands in the same place every time. That is also why the aiming arc is the first 0.6 seconds of the real flight, not a guess.
- Skill is measurable. A look-ahead autopilot flies each day against a hands-off throw. On the first six skies, letting go reaches 128 to 417 metres; careful holding reaches 205 to 527.
- Every line is drawn by the same wobbly pen, sound is made on the spot with WebAudio, and the whole thing is about 28 kB of script. 24 tests. No account, no server, no tracking.
Everything in the film is real footage from the page, or drawn from the game's own functions. The throw is a real mouse drag. The 524.9 metre flight crosses 7 columns of warm air, and the holds in it were chosen by that same look-ahead autopilot.
Play it: pratyushshivam.github.io/paper-plane/
Source: github.com/pratyushshivam/paper-plane
The film and the full write-up: https://www.pratyushshivam.com/projects/paper-plane/

Top comments (0)