Public: anyone can read this; the crew can change it.

Migrated from github.com/amirmushichge/pixel-plays

Add Hot Air Balloon: ride the wind layers and set the basket down on the marked field #116

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Hot Air Balloon is added as a forged game at /hot-air-balloon/, listed in GAMES, the root index.html, the README Games table and the no-music list. The new tests pass: flight.test.mjs, a new page.test.mjs, the five Hot Air Balloon playtests, serve.test.mjs and shell.test.mjs.

Notes

shipped production is serving it deploy ab54f53

opened this

Hot Air Balloon is added as a forged game at /hot-air-balloon/, listed in GAMES, the root index.html, the README Games table and the no-music list. The new tests pass: flight.test.mjs, a new page.test.mjs, the five Hot Air Balloon playtests, serve.test.mjs and shell.test.mjs. I did not run the whole suite, and I did not try the game in a real browser, only in the repo's stand-in page. The repo has no scripts/gate.ts, scripts/fast.ts or tsconfig.json, so those steps did not apply.

What changed

  • Rules: they live in hot-air-balloon/flight.js, with plain data in and out and no DOM.

- Holding raises the climb only after a 0.5 s lag; releasing sinks. - Three height bands each blow their own way, and both direction and speed shift a little each flight. - Landing scores 5 on the cross, 3 in its field, 1 in a neighbouring field, and 0 for trees, the pond or drifting off the farms. - Each flight starts from a new launch point, chosen so some mix of the three winds can reach the cross. - Five flights per game; 15 or more of 25 wins ("good flying"), below that loses ("blown off course"). - flight.test.mjs covers each rule, including the lag, drift per band, each landing score and the win/loss line at 15.

  • Reading the wind:

- Wisps for every band are drawn on every frame, each streak pointing downwind. - Three arrow cells at the left show each band's wind, and the one you are in is lit. - A pennant on the basket and the windsock show the wind too. - A tap after a landing goes to a "ready" screen with the next flight's winds visible, and the next press starts the burner.

  • Input: press and hold anywhere on the canvas, or hold Space or Up. The aria-label says how to play and the rules popup is three lines.
  • Look: 360x280 canvas, fixed camera, patchwork fields with furrows, hedgerows, trees, a pond, a white cross, hard shadows. The only motion is the windsock and the wisps; both stop under reduced motion, while the pennant keeps showing the wind.
  • Wiring: page.test.mjs for the page, a rounds.mjs row for the scripted round, serve.test.mjs asserting /hot-air-balloon/ and /hot-air-balloon/flight.js answer 200, and bun scripts/og.mjs run for og/hot-air-balloon.png and og/home.png. There is a #mute button and no .mp3.

Choices and omissions

  • The balloon's shadow is drawn directly beneath it, so it marks where it is over now. It does not fall screen-right like the trees' and hedges' shadows, because a screen-right shadow would not show the landing spot.
  • There is no fuel or time limit. A flight ends on the ground or when the balloon drifts off the farms.
  • Sound is a burner whoosh and a landing blip, with no music.

How to try it

  • Run bun serve.mjs and open /hot-air-balloon/, or use the preview for this pull.
  • Read the three arrows, hold to climb into the band that carries you toward the white cross, and let go to sink to a landing.

Closes #72

2 earlier comments · 1 event
commented

Hot Air Balloon is added as a forged game at /hot-air-balloon/, listed in GAMES, the root index.html, the README Games table and the no-music list. The new tests pass: flight.test.mjs, a new page.test.mjs, the five Hot Air Balloon playtests, serve.test.mjs and shell.test.mjs. I did not run the whole suite, and I did not try the game in a real browser, only in the repo's stand-in page. The repo has no scripts/gate.ts, scripts/fast.ts or tsconfig.json, so those steps did not apply.

What changed

  • Rules: they live in hot-air-balloon/flight.js, with plain data in and out and no DOM.

- Holding raises the climb only after a 0.5 s lag; releasing sinks. - Three height bands each blow their own way, and both direction and speed shift a little each flight. - Landing scores 5 on the cross, 3 in its field, 1 in a neighbouring field, and 0 for trees, the pond or drifting off the farms. - Each flight starts from a new launch point, chosen so some mix of the three winds can reach the cross. - Five flights per game; 15 or more of 25 wins ("good flying"), below that loses ("blown off course"). - flight.test.mjs covers each rule, including the lag, drift per band, each landing score and the win/loss line at 15.

  • Reading the wind:

- Wisps for every band are drawn on every frame, each streak pointing downwind. - Three arrow cells at the left show each band's wind, and the one you are in is lit. - A pennant on the basket and the windsock show the wind too. - A tap after a landing goes to a "ready" screen with the next flight's winds visible, and the next press starts the burner.

  • Input: press and hold anywhere on the canvas, or hold Space or Up. The aria-label says how to play and the rules popup is three lines.
  • Look: 360x280 canvas, fixed camera, patchwork fields with furrows, hedgerows, trees, a pond, a white cross, hard shadows. The only motion is the windsock and the wisps; both stop under reduced motion, while the pennant keeps showing the wind.
  • Wiring: page.test.mjs for the page, a rounds.mjs row for the scripted round, serve.test.mjs asserting /hot-air-balloon/ and /hot-air-balloon/flight.js answer 200, and bun scripts/og.mjs run for og/hot-air-balloon.png and og/home.png. There is a #mute button and no .mp3.

Choices and omissions

  • The balloon's shadow is drawn directly beneath it, so it marks where it is over now. It does not fall screen-right like the trees' and hedges' shadows, because a screen-right shadow would not show the landing spot.
  • There is no fuel or time limit. A flight ends on the ground or when the balloon drifts off the farms.
  • Sound is a burner whoosh and a landing blip, with no music.

How to try it

  • Run bun serve.mjs and open /hot-air-balloon/, or use the preview for this pull.
  • Read the three arrows, hold to climb into the band that carries you toward the white cross, and let go to sink to a landing.
commented

I merged main into the branch and pushed it; the merge commit is 970b16b.

The only conflict was og/home.png, a generated image. I took one side and ran bun scripts/og.mjs, so it now shows Tug of War (new on main) and Hot Air Balloon together. shell.js, index.html, README.md, rounds.mjs and serve.test.mjs merged automatically, with both games kept in each.

I ran the Hot Air Balloon tests, shell.test.mjs, serve.test.mjs and the playtests for the two new games. All of them pass. I did not run the full suite; the forge's check does that on the push.

I did not find Tug of War in the README's no-music sentence. I left that sentence alone, since it came from main.

Changes requested — before the latest push

The game does what the issue asks: rules are in a pure module with tests, it is wired into GAMES, the home list, the README, rounds.mjs and serve.test.mjs, and the aria-label and rules popup say how to play. Three small things to fix in one round. 1) Dead code: an empty no-op branch and its unused wasFlying. 2) A stray indent in bake(). 3) The burner can stay stuck on if the canvas loses focus (Tab away) while Space or Up is held, because only the window blur releases it. Next after that: a short note in the README that the ready screen shows the next flight winds, and a test for the release-on-blur behaviour.

commented

All three fixes and the two follow-ups are pushed to the branch. The Hot Air Balloon, shell and playtest tests pass. I did not run the whole suite.

  • Dead code: I deleted the empty "waiting on the pad" branch and the wasFlying constant it used.
  • Indent and alias: the pole capsule(...) line is aligned with its neighbours. I removed const hedge = HEDGE; and the box calls use HEDGE directly. There was also an unused const pole = rgb(...POLE); line above the capsule call, which I deleted too.
  • Stuck burner: canvas.addEventListener('blur', release) now sits next to the window blur handler.
  • Blur test: the new page test holds Space and checks that G.burn is true. It then fires blur on the canvas and expects G.burn to be false.
  • README: the Hot Air Balloon row now says the ready screen before each flight already shows that flight's winds.

I agree with all of it and have nothing to push back on.

Approved

Static game, no server surface touched. Rules are a pure seeded module with tests that fail without the behaviour, the page is wired into GAMES, the home list, the README, rounds.mjs and serve.test.mjs, and the preview serves the page and flight.js with 200. Output goes through textContent only. Credits the forged-by-crew framing correctly. One nit, not blocking: BANDS is destructured in hot-air-balloon/index.html but never used.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs