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

Migrated from github.com/amirmushichge/pixel-plays

Add Bell Tower: ring the peal back on four bells, one bell longer each round #69

opened this

Merged 32d 11h ago, live in production

Bell Tower is added at /bell-tower/. The new peal tests, serve.test.mjs and the four Bell Tower playtests pass. I haven't run the full suite; the forge runs it on push.

Notes

opened this

Bell Tower is added at /bell-tower/. The new peal tests, serve.test.mjs and the four Bell Tower playtests pass. I haven't run the full suite; the forge runs it on push. I also played one peal through the page in the playtest harness: the score went to 3 and the HUD updated.

What changed

  • Rules in bell-tower/peal.js: it holds all the rules as plain data in and out, with no DOM.
    • A seeded peal, so the same seed gives the same peal.
    • The next peal is the last one plus one bell, starting at three.
    • A right peal of length n scores n.
    • A wrong bell ends that peal with a miss, and the same peal plays again.
    • The third miss ends the game.
    • A bell stays locked for 0.5 s after it rings.
  • Tests in bell-tower/peal.test.mjs: 13 tests cover each of those rules plus bad input.
  • Page: it is built on the engine in the same shape as Tightrope. The tower is an open stone floor with four pillars and four bells in different metals, smallest to largest. A ringer moves to the rope that was pulled, pigeons sit on the back parapet, and 1–4 are painted under the ropes.
  • Input: a tap hits one of four equal columns, so each target is about 90 px wide, which suits a phone. Keys are 1–4, or the arrows left, down, up, right in the order the bells hang. The aria-label says how to play and the rules popup is four lines.
  • Sound and motion: bell notes are Web Audio with four partials each and no files. A bell flashes while it swings whether or not sound is on. Pigeon motion stops under prefers-reduced-motion, and the bell swing shrinks to a small angle there.
  • Listings: shell.js GAMES, the root index.html <li>, the README Games table and the README no-music list. The README's shell.js kinds comment and the allowed-kinds list in serve.test.mjs now include Memory. The home kind filter builds itself from GAMES, so it needed no change. bun scripts/og.mjs was run, so og/bell-tower.png, og/home.png and the share tags are updated. No .mp3 is committed.

Decisions to review

  • Too-fast pulls: the issue says ringing too fast is a miss, but its test list says pulling a swinging bell is ignored. I followed the test list. A rushed pull does nothing except show "wait for that bell to swing back", and only a wrong bell counts as a miss.
  • Bell shape: the bells still look a little like gourds, because the engine's round capsules can't give a flat lip. I stopped there.
  • No time limit: there is no timeout on the player's turn.
  • Not done: scripts/design-lint.ts doesn't exist in this repo, so I didn't run it. The tsc check only printed its help text because there is no tsconfig.

Try it: bun serve.mjs, open /bell-tower/, listen to the peal, then ring it back with 1–4 or by tapping the ropes.

🤖 Generated with Claude Code

Closes #59

3 earlier comments
commented

Bell Tower is added at /bell-tower/. The new peal tests, serve.test.mjs and the four Bell Tower playtests pass. I haven't run the full suite; the forge runs it on push. I also played one peal through the page in the playtest harness: the score went to 3 and the HUD updated.

What changed

  • Rules in bell-tower/peal.js: it holds all the rules as plain data in and out, with no DOM.
    • A seeded peal, so the same seed gives the same peal.
    • The next peal is the last one plus one bell, starting at three.
    • A right peal of length n scores n.
    • A wrong bell ends that peal with a miss, and the same peal plays again.
    • The third miss ends the game.
    • A bell stays locked for 0.5 s after it rings.
  • Tests in bell-tower/peal.test.mjs: 13 tests cover each of those rules plus bad input.
  • Page: it is built on the engine in the same shape as Tightrope. The tower is an open stone floor with four pillars and four bells in different metals, smallest to largest. A ringer moves to the rope that was pulled, pigeons sit on the back parapet, and 1–4 are painted under the ropes.
  • Input: a tap hits one of four equal columns, so each target is about 90 px wide, which suits a phone. Keys are 1–4, or the arrows left, down, up, right in the order the bells hang. The aria-label says how to play and the rules popup is four lines.
  • Sound and motion: bell notes are Web Audio with four partials each and no files. A bell flashes while it swings whether or not sound is on. Pigeon motion stops under prefers-reduced-motion, and the bell swing shrinks to a small angle there.
  • Listings: shell.js GAMES, the root index.html <li>, the README Games table and the README no-music list. The README's shell.js kinds comment and the allowed-kinds list in serve.test.mjs now include Memory. The home kind filter builds itself from GAMES, so it needed no change. bun scripts/og.mjs was run, so og/bell-tower.png, og/home.png and the share tags are updated. No .mp3 is committed.

Decisions to review

  • Too-fast pulls: the issue says ringing too fast is a miss, but its test list says pulling a swinging bell is ignored. I followed the test list. A rushed pull does nothing except show "wait for that bell to swing back", and only a wrong bell counts as a miss.
  • Bell shape: the bells still look a little like gourds, because the engine's round capsules can't give a flat lip. I stopped there.
  • No time limit: there is no timeout on the player's turn.
  • Not done: scripts/design-lint.ts doesn't exist in this repo, so I didn't run it. The tsc check only printed its help text because there is no tsconfig.

Try it: bun serve.mjs, open /bell-tower/, listen to the peal, then ring it back with 1–4 or by tapping the ropes.

🤖 Generated with Claude Code

commented

I merged main into the branch and pushed it. It should merge cleanly now.

  • README.md: the only conflict was the list of games without music. I kept main's line, which now includes Tram Line, and added Bell Tower: "Tightrope, Tram Line and Bell Tower".
  • og/home.png: I took main's version and re-ran bun scripts/og.mjs. That regenerated the home card with both new games, and the Bell Tower card is unchanged.
  • Tests: serve.test.mjs, shell.test.mjs and bell-tower pass, 57 in all. I did not re-run the playtests or the rest of the suite after the merge.

The Bell Tower change itself is as described in the earlier pull description.

commented

The HUD peal length now updates when the tower starts a longer peal, so it no longer lags a round behind. You were right about the cause. seq grows in Peal.advance, but the HUD was only redrawn on peal, miss and over.

  • Fix: the listen handler in act() (bell-tower/index.html:261) now calls renderHud() after the status note, as you suggested.
  • Test: bell-tower/page.test.mjs boots the page with boot('bell-tower'). It waits for the first turn and checks #length reads 3. It then taps the rope columns at x = 45, 135, 225 and 315 to ring the peal back, and checks #score reads 3. After the next turn starts it checks #length reads 4.
  • Check: with the index.html change stashed, the new test fails with Expected: "4", Received: "3". With the fix, all 14 bell-tower tests pass. I did not re-run the rest of the suite.

I'm not disputing any of your other points.

commented

I merged main into the branch again and pushed it; it should merge cleanly now.

  • README.md: the conflict was the list of games without music again. I took main's line, which now ends "Tram Line and Archery", and made it "Tram Line, Archery and Bell Tower". The Bell Tower row in the Games table is still there.
  • og/home.png: I took main's image and re-ran bun scripts/og.mjs, so the home card is regenerated.
  • Tests: serve.test.mjs, shell.test.mjs and bell-tower pass, 59 in all, including the peal tests and the page test. I did not re-run the playtests for the other games or the rest of the suite.
Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs