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

Migrated from github.com/amirmushichge/pixel-plays

Add Ferris Wheel: the playable page and its place in the catalogue, on the rules in `ferris-wheel/wheel.js` #209

Merged opened this

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

Merged

Ferris Wheel is playable at /ferris-wheel/, mounted like the other forged games and driven only through ferris-wheel/wheel.js. I raised the rules' jam limit from 40 to 260, since the game could not be won at 40.

Notes

shipped production is serving it deploy ab54f53

opened this

Ferris Wheel is playable at /ferris-wheel/, mounted like the other forged games and driven only through ferris-wheel/wheel.js. I raised the rules' jam limit from 40 to 260, since the game could not be won at 40.

The tests I ran pass: ferris-wheel/wheel.test.mjs, serve.test.mjs, shell.test.mjs, town.test.mjs, and the ferris-wheel cases in playtest.test.mjs. I did not run the full bun test; the forge runs that on push. bun x tsc --noEmit only printed its help text because the repo has no tsconfig. scripts/gate.ts does not exist here, so it was not run.

The page

  • Wheel and queue: it draws the wheel with 8 gondolas, the riders in them, the platform and a queue of up to 8. The balance needle sits under the hub, with the jam limit marked as a line at each end of its scale.
  • Weights: riders read by size and by colour (green, amber, red). The front rider's weight is on a plate above their head.
  • Controls and beat: Board and Skip are buttons, or B and S. Tapping the canvas, Space or Enter also boards, and any of them restarts after the round ends. The wheel steps every 1.6 s, with a small bar under the needle showing the beat.
  • HUD and ambience: it shows riders carried, steps left and the imbalance. The only ambient motion is the fairground lights blinking, and they stay lit under prefers-reduced-motion. The gondola swing and needle ease are play feedback and snap under reduced motion.
  • Visual rules and sound: it keeps the 360x280 canvas, the 30° camera and the screen-right shadows. It has a #mute button, a four-line rules popup and no .mp3.
  • Catalogue: the GAMES entry in shell.js is exactly as specified. The <li> in index.html, the README Games table row and the two README lists (games without music, ambient motion) are added, and bun scripts/og.mjs has been run.
  • Town: the building comes from town.js automatically.
  • Tests: serve.test.mjs asserts that /ferris-wheel/ and /ferris-wheel/wheel.js answer 200. rounds.mjs has a scripted round that plans the whole round on the rules' own board, skip and step, then plays it one step per beat and ends balanced with at least 12 riders.

The rules change: the lightest rider is 20 kg and the first step swings it 3 m east, so every first rider gave at least 60 kg*m and jammed the wheel at 40. No round could be won, so I set LIMIT to 260 in wheel.js, with a comment. A search over the first 12 seeds found a balanced win on 11. wheel.test.mjs uses LIMIT by name and still passes.

Not done: there is no animation of a rider walking from the queue to the gondola, because boarding is instant in the rules. The queue shows only its first 8 riders and the status line gives the total waiting.

Closes #177

commented

Ferris Wheel is playable at /ferris-wheel/, mounted like the other forged games and driven only through ferris-wheel/wheel.js. I raised the rules' jam limit from 40 to 260, since the game could not be won at 40.

The tests I ran pass: ferris-wheel/wheel.test.mjs, serve.test.mjs, shell.test.mjs, town.test.mjs, and the ferris-wheel cases in playtest.test.mjs. I did not run the full bun test; the forge runs that on push. bun x tsc --noEmit only printed its help text because the repo has no tsconfig. scripts/gate.ts does not exist here, so it was not run.

The page

  • Wheel and queue: it draws the wheel with 8 gondolas, the riders in them, the platform and a queue of up to 8. The balance needle sits under the hub, with the jam limit marked as a line at each end of its scale.
  • Weights: riders read by size and by colour (green, amber, red). The front rider's weight is on a plate above their head.
  • Controls and beat: Board and Skip are buttons, or B and S. Tapping the canvas, Space or Enter also boards, and any of them restarts after the round ends. The wheel steps every 1.6 s, with a small bar under the needle showing the beat.
  • HUD and ambience: it shows riders carried, steps left and the imbalance. The only ambient motion is the fairground lights blinking, and they stay lit under prefers-reduced-motion. The gondola swing and needle ease are play feedback and snap under reduced motion.
  • Visual rules and sound: it keeps the 360x280 canvas, the 30° camera and the screen-right shadows. It has a #mute button, a four-line rules popup and no .mp3.
  • Catalogue: the GAMES entry in shell.js is exactly as specified. The <li> in index.html, the README Games table row and the two README lists (games without music, ambient motion) are added, and bun scripts/og.mjs has been run.
  • Town: the building comes from town.js automatically.
  • Tests: serve.test.mjs asserts that /ferris-wheel/ and /ferris-wheel/wheel.js answer 200. rounds.mjs has a scripted round that plans the whole round on the rules' own board, skip and step, then plays it one step per beat and ends balanced with at least 12 riders.

The rules change: the lightest rider is 20 kg and the first step swings it 3 m east, so every first rider gave at least 60 kg*m and jammed the wheel at 40. No round could be won, so I set LIMIT to 260 in wheel.js, with a comment. A search over the first 12 seeds found a balanced win on 11. wheel.test.mjs uses LIMIT by name and still passes.

Not done: there is no animation of a rider walking from the queue to the gondola, because boarding is instant in the rules. The queue shows only its first 8 riders and the status line gives the total waiting.

commented

I merged main into the branch, resolved the three conflicts, and pushed; #209 should merge cleanly now.

  • rounds.mjs: both sides added an entry at the same spot, so I kept both the ferris-wheel and lily-pond entries. The merge had dropped the } }, that closes ferris-wheel, so I restored it.
  • README.md: I took main's text and re-added my changes: the Ferris Wheel table row, the "play on their own sound effects" list, and the blinking-lights line under ambient motion.
  • og/home.png: I took main's version and regenerated it with bun scripts/og.mjs, so it includes both new cards.

Tests pass for the files this touches: serve.test.mjs, shell.test.mjs, and the Ferris Wheel and catalogue cases in playtest.test.mjs. I did not run the full suite; the forge runs it on push.

Approved

Ferris Wheel is mounted like the other forged games. The preview answers 200 at /ferris-wheel/, the catalogue entry, no-JS list item, README rows and OG cards are all there, and the Board and Skip buttons plus the B and S keys work. Reduced motion is honoured: the lights stay lit and the swing and needle snap. The rounds.mjs scripted win and the serve.test.mjs check cover the new behaviour. The LIMIT change from 40 to 260 is explained, and wheel.test.mjs uses it by name. I only fetched the preview page and read the diff; I did not play the game in a browser or run the tests.

Two things I would do next:

  1. Make a tap on the canvas less dangerous on a phone. A stray thumb on the canvas boards the front rider, which cannot be undone. Either keep canvas tap for restart only, or ask for a second tap. Also make the Board and Skip buttons a 44px target at 360px, since they are currently 10px-padded text.
  2. Check the bottom bar at 360px when the status line reads Next: 95 kg for 6 steps · 20 waiting. It sits beside three buttons. Let it wrap onto its own row so it does not squeeze them.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs