For a Flappy Bird JavaScript learning project, define those rules separately before drawing a familiar character. This original gap-flight model uses neutral rectangles, a fixed opening and one score per obstacle-pair ID. The complete prompt below requests native source and tests; the companion supplies a neutral local game to compare with those rules.

Define an original field and obstacle pair
Use a 320 × 240 logical field. The flyer is a 16 × 16 rectangle with initial top-left (64,112) and vertical velocity zero. Its horizontal position stays fixed.
Each original pair is 36 pixels wide, starting at x=320. The upper block occupies y=0–80; the lower occupies y=160–240. The gap is y=80–160. Pairs move left at 70 logical pixels per simulation second, with the first at time zero and another every 2.4 seconds.
The author's reference README describes gravity, upward flap input, gap passage and collision ending a run. Use that gameplay structure only; its code, assets, tuning, storage and fairness/frame-rate claims are not this model's evidence. Author Reference: Flappy Bird
Retain one stable pair ID for both blocks, such as generation 1/pair 1. The two shapes share a single resolution record. There is no random gap placement, commercial bird artwork, pipe asset, sound or leaderboard.
Make a fresh flap reset velocity
Downward is positive. Gravity is 400 logical pixels per second squared. A fresh Flap while Running sets vertical velocity to −180 pixels per second, including when the flyer is already airborne. It does not subtract another 180 from the existing velocity.
Use a native Flap button and a focused game region's Space/Arrow Up inputs. One fresh press or pointer activation produces one action. Ignore repeated keydown while held; release is required for another keyboard flap. Avoid counting both pointer and resulting click as two actions, or a focused button's native activation plus the region's key handler as two flaps.
A new press in flight is allowed here. That deliberately differs from a ground-only jump controller. Do not reject it because the flyer has not landed.
Ready, Paused and Lost ignore Flap. Start changes Ready to Running and starts the original spawn schedule; Start itself is not a flap. This makes the initial velocity-zero fixture reproducible.
State the integration rule and expected trace
The proposed fixed step is 0.01 seconds. Under constant gravity, update position with the previous velocity: new y = old y + old velocity × step + 0.5 × gravity × step², then update velocity by gravity × step.
If a fresh flap is applied at the start of a synthetic t=0 motion fixture, the expected y after 0.1 second is 112−18+2=96 and velocity is −140. After 0.2 second, y=84 and velocity=−100. A new flap then sets velocity back to −180, not −280.
These are mathematical expected values for the selected integration rule, not a performed playthrough. Use simulation ticks for schedule comparisons and avoid accumulated floating-point time moving a nominal spawn past its tick.
A single animation scheduler processes at most 10 fixed steps/0.1 simulation second per frame, discarding excess elapsed time as a documented slowdown policy. Draw calls do not integrate gravity, spawn pairs or award points. Paused/hidden intervals advance no simulation time.
Test the gap only when horizontal intervals overlap
The flyer spans x=64–80. A pair whose left edge is 80 only touches the flyer horizontally; strict positive overlap has not begun. The same boundary rule applies to the upper and lower blocks.
When the pair overlaps horizontally, a flyer top of 80 fits exactly below the upper block. A top of 144 gives bottom 160 and fits exactly above the lower block. Thus top y=80–144 is inside this fixed gap, inclusive.
At y=145, the bottom reaches 161 and overlaps the lower block by one pixel. At y=79, the flyer overlaps the upper block by one pixel. These are collision fixtures under horizontal overlap, not universal restrictions on y when no pair is beside the flyer.
The field boundaries are separate: y<0 or y+16>240 loses. Border contact alone at y=0 or bottom 240 is permitted. Without any flap, the initial gravity-only trace reaches y=224.5 at t=0.75, so bottom 240.5 predicts a boundary loss before the first pair reaches the flyer.
Use strict rectangular overlap and swept/subdivided checks across each movement interval. A large final-position jump cannot bypass a block or field boundary and be accepted as a safe pass. Test the collision cases again after changing the companion.
Award a point to a passed pair once
After collision and boundary checks, a living run can credit a pair only when its right edge is strictly less than flyer-left x=64. At pair x=28, right=64: no point yet. At x=27.9, right=63.9: the isolated passage fixture qualifies.
The upper and lower blocks do not award separately. Transition that pair once to Passed, add one point and remove its active collision record. Repeated updates of the same passed ID cannot add points.
For the pair starting x=320, right=356−70 × age. It crosses the strict threshold after age 292/70 seconds. On the chosen 0.01-second ticks, age 4.17 has right 64.1, while 4.18 has right 63.4. Those are geometry fixtures conditional on the run remaining alive, not a claim that an unflapped flyer survives to score.
If a block or boundary collision occurs on the same update, Lost wins and no point is awarded. The ongoing fixed pair stream has no three-pair finish condition; it continues until loss or pause.
Reset the clock, input and generation together
Use native Start, Flap, Pause, Resume and Reset, with DOM score, state, flyer y/velocity and pair status. The focused region includes the controls. Leaving it or hiding the page pauses an active run and clears held input.
Resume starts a fresh timing stamp and empty elapsed accumulator; it neither replays hidden seconds nor creates another scheduler. Lost ignores gameplay until Reset.
Reset cancels the previous generation and restores Ready, score zero, flyer (64,112), velocity zero, clock/spawn index zero and no active pairs. Future callbacks from an earlier generation cannot spawn, move, score or terminate the new run.
Keyboard, focus, original drawing, host script execution and layout at production article width/360 px require later verification. Fixed gaps do not establish guaranteed playability or identical results at every frame rate.
Copy this prompt to prepare the original gap-flight prototype
Create one complete, self-contained US-English HTML companion for “Gap Flight”. Return the full HTML document, with inline CSS and any JavaScript needed for the local interactions. Use the original scenario, named records, numbers and expected cases below.
Design the page for this task: use clearly labeled input or source records, a readable result or worked example, and an adjacent explanation of the evidence. Use a restrained visual hierarchy, left-aligned text, readable tables or stacked records, and a responsive layout at 720px and 360px. Provide meaningful labeled controls for Start; Flap ↑; Pause; Resume; Reset; Apply lab flap; Advance lab 0.10 s; Reset lab. Use keyboard-accessible native controls and visible focus. Keep the complete content readable without an external dependency.
The following brief supplies the substantive content and constraints. Native-format requests describe the material to represent or copy manually; this HTML must not pretend to create DOCX, XLSX, PDF, PPTX, H5P or another native file, run Python/Flask/Django/Snowflake/Power BI, connect a live service, send messages, or perform an authorized real-world action. Where the task requires a native source, actual observation or separate approval, retain that requirement and leave unsupplied evidence blank.
Create complete original native HTML/CSS/JavaScript source and manual test matrix for a neutral gap-flight prototype. Reference https://github.com/pyforgedev/flappy-bird for gravity/flap/gap/collision structure only; no copied source, sprites, pipes, logos, sounds, storage, fairness or FPS-identical claims. No network, accounts or leaderboard.
Logical field 320 × 240. Flyer 16 × 16, initial top-left (64,112), fixed x=64, velocity zero. Gravity 400 downward pixels/second². While Running, each fresh Flap sets velocity to −180, including airborne, never subtracts 180 from previous velocity. Ready/Paused/Lost ignore Flap. Start only Ready, time zero and first pair; Start does not flap.
Pairs width 36, left x=320, upper rectangle y=0–80/lower 160–240, gap 80–160. Move left 70 logical pixels/second. Spawn first at zero and every 2.4 simulation seconds; generation/spawn-index ID shared by both halves. Fixed pattern, no randomization or finite finish.
Fixed step 0.01 seconds. Position uses prior velocity: y += velocity × step + 0.5 × 400 × step², then velocity += 400 × step. Tick-based spawn comparisons, one scheduler, maximum 10 steps/0.1 simulation second per frame; discard excess as documented slowdown. Draw never changes physics/spawn/score. Fresh t=0 flap fixture: after 0.1 second y=96/velocity=−140; after 0.2 y=84/velocity=−100; next fresh flap resets to −180, not −280.
Native Flap button, focused-region Space/Arrow Up and fresh pointer activation share one action. Ignore held/repeated keydown until release. Suppress duplicate pointer+click and native button activation+region keyboard handling. Focus region includes buttons; no outside-region key interception. Clear held/pending input on release/Pause/hidden/focus leaving/Reset.
Strict positive overlap on both axes. Pair x=80 touches flyer-right 80 only, no horizontal hit. With horizontal overlap, flyer y=80 or 144 fits gap; 79 overlaps upper; 145 overlaps lower. Field y<0 or bottom>240 loses; touching 0/240 allowed. Gravity-only initial t=0.75 gives y=224.5/bottom=240.5, expected loss, not a played result. Swept/subdivided interval collision must prevent large-step tunneling.
Collision/boundary first; Lost immediately prevents points. A pair right<64 passes once: x=28/right=64, no point; x=27.9/right=63.9 qualifies in isolated living fixture. Shared pair ID awards 1, not 2 for halves; transition once/remove, repeat inert. First pair age 4.17 has right 64.1/no score; 4.18 has right 63.4/qualifies if alive. These passage fixtures do not claim no-flap survival.
Native Start/Flap/Pause/Resume/Reset, DOM score/state/y/velocity/pair status. Pause/hidden/focus leaving freezes simulation and clears input. Resume uses a fresh stamp, empty accumulator, no catchup and one loop. Reset cancels old generation; restore Ready, score zero, flyer (64,112), velocity zero, time zero, spawn index zero and no pairs. Old callbacks inert; terminal ignores gameplay.
Test impulse set versus addition, airborne fresh input/held/repeated/double-handler protection, integration fixtures, gap/field borders and sweep, shared-ID one-point crossing, collision-before-score, ongoing spawns, pause/Resume/hidden/Reset generations. Actual code/playability/drawings/keyboard/production article width/360 px/host tests pending; do not invent captured test results. End with separate optional NOS reading copy, an optional Explore NOS link without feature promises; verify scripts/controls before claiming hosted play.
COMPLETE AUTHORED SCENARIO AND EXPECTED CASES
The following is the supplied reading/teaching/calculation record to represent in the companion. Preserve its particular content, examples, source references and unknowns. Wording about a future native implementation refers to that native task, not permission to omit this HTML companion.
# Flappy Bird JavaScript: Separate Flap Input, Gap Collision and Pair Scoring
A held key keeps applying an upward impulse, so the flyer never falls. Another prototype gives two points for passing the upper and lower halves of one obstacle. A third awards a point on an update that should end in collision.
For a Flappy Bird JavaScript learning project, define those rules separately before drawing a familiar character. This original gap-flight model uses neutral rectangles, a fixed opening and one score per obstacle-pair ID. The complete prompt below requests native source and tests; the companion supplies a neutral local game to compare with those rules.
## Define an original field and obstacle pair
Use a 320 × 240 logical field. The flyer is a 16 × 16 rectangle with initial top-left (64,112) and vertical velocity zero. Its horizontal position stays fixed.
Each original pair is 36 pixels wide, starting at x=320. The upper block occupies y=0–80; the lower occupies y=160–240. The gap is y=80–160. Pairs move left at 70 logical pixels per simulation second, with the first at time zero and another every 2.4 seconds.
The author's reference README describes gravity, upward flap input, gap passage and collision ending a run. Use that gameplay structure only; its code, assets, tuning, storage and fairness/frame-rate claims are not this model's evidence. [Author Reference: Flappy Bird](https://github.com/pyforgedev/flappy-bird)
Retain one stable pair ID for both blocks, such as generation 1/pair 1. The two shapes share a single resolution record. There is no random gap placement, commercial bird artwork, pipe asset, sound or leaderboard.
## Make a fresh flap reset velocity
Downward is positive. Gravity is 400 logical pixels per second squared. A fresh Flap while Running sets vertical velocity to −180 pixels per second, including when the flyer is already airborne. It does not subtract another 180 from the existing velocity.
Use a native Flap button and a focused game region's Space/Arrow Up inputs. One fresh press or pointer activation produces one action. Ignore repeated keydown while held; release is required for another keyboard flap. Avoid counting both pointer and resulting click as two actions, or a focused button's native activation plus the region's key handler as two flaps.
A new press in flight is allowed here. That deliberately differs from a ground-only jump controller. Do not reject it because the flyer has not landed.
Ready, Paused and Lost ignore Flap. Start changes Ready to Running and starts the original spawn schedule; Start itself is not a flap. This makes the initial velocity-zero fixture reproducible.
## State the integration rule and expected trace
The proposed fixed step is 0.01 seconds. Under constant gravity, update position with the previous velocity: new y = old y + old velocity × step + 0.5 × gravity × step², then update velocity by gravity × step.
If a fresh flap is applied at the start of a synthetic t=0 motion fixture, the expected y after 0.1 second is 112−18+2=96 and velocity is −140. After 0.2 second, y=84 and velocity=−100. A new flap then sets velocity back to −180, not −280.
These are mathematical expected values for the selected integration rule, not a performed playthrough. Use simulation ticks for schedule comparisons and avoid accumulated floating-point time moving a nominal spawn past its tick.
A single animation scheduler processes at most 10 fixed steps/0.1 simulation second per frame, discarding excess elapsed time as a documented slowdown policy. Draw calls do not integrate gravity, spawn pairs or award points. Paused/hidden intervals advance no simulation time.
## Test the gap only when horizontal intervals overlap
The flyer spans x=64–80. A pair whose left edge is 80 only touches the flyer horizontally; strict positive overlap has not begun. The same boundary rule applies to the upper and lower blocks.
When the pair overlaps horizontally, a flyer top of 80 fits exactly below the upper block. A top of 144 gives bottom 160 and fits exactly above the lower block. Thus top y=80–144 is inside this fixed gap, inclusive.
At y=145, the bottom reaches 161 and overlaps the lower block by one pixel. At y=79, the flyer overlaps the upper block by one pixel. These are collision fixtures under horizontal overlap, not universal restrictions on y when no pair is beside the flyer.
The field boundaries are separate: y<0 or y+16>240 loses. Border contact alone at y=0 or bottom 240 is permitted. Without any flap, the initial gravity-only trace reaches y=224.5 at t=0.75, so bottom 240.5 predicts a boundary loss before the first pair reaches the flyer.
Use strict rectangular overlap and swept/subdivided checks across each movement interval. A large final-position jump cannot bypass a block or field boundary and be accepted as a safe pass. Test the collision cases again after changing the companion.
## Award a point to a passed pair once
After collision and boundary checks, a living run can credit a pair only when its right edge is strictly less than flyer-left x=64. At pair x=28, right=64: no point yet. At x=27.9, right=63.9: the isolated passage fixture qualifies.
The upper and lower blocks do not award separately. Transition that pair once to Passed, add one point and remove its active collision record. Repeated updates of the same passed ID cannot add points.
For the pair starting x=320, right=356−70 × age. It crosses the strict threshold after age 292/70 seconds. On the chosen 0.01-second ticks, age 4.17 has right 64.1, while 4.18 has right 63.4. Those are geometry fixtures conditional on the run remaining alive, not a claim that an unflapped flyer survives to score.
If a block or boundary collision occurs on the same update, Lost wins and no point is awarded. The ongoing fixed pair stream has no three-pair finish condition; it continues until loss or pause.
## Reset the clock, input and generation together
Use native Start, Flap, Pause, Resume and Reset, with DOM score, state, flyer y/velocity and pair status. The focused region includes the controls. Leaving it or hiding the page pauses an active run and clears held input.
Resume starts a fresh timing stamp and empty elapsed accumulator; it neither replays hidden seconds nor creates another scheduler. Lost ignores gameplay until Reset.
Reset cancels the previous generation and restores Ready, score zero, flyer (64,112), velocity zero, clock/spawn index zero and no active pairs. Future callbacks from an earlier generation cannot spawn, move, score or terminate the new run.
Keyboard, focus, original drawing, host script execution and layout at production article width/360 px require later verification. Fixed gaps do not establish guaranteed playability or identical results at every frame rate.
Implement the local companion rather than returning a text-only plan. Preserve every numerical fixture and the distinction between illustrative expectations and actual evidence. Any native-runtime or classroom tests mentioned above remain tests to perform in the proper environment; do not mark them passed. Keep edits and practice responses in this open page only, without claiming persistent storage. Provide invalid/missing-input feedback and reset behavior that agree with this specific brief. Do not claim accessibility certification, learning gains, real approvals or test results that were not observed.
Review: a reading copy of the impulse and crossing checks
Keep the native source and original test matrix together. Use the companion to show the flap trace, gap boundaries and one-pair score rule.
Verify actual physics, input, collisions and layout before presenting a playable hosted example. A displayed score does not establish that two blocks share one correctly resolved pair.
The useful prototype makes the input impulse, collision decision and single pair credit separately inspectable.