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

Migrated from github.com/amirmushichge/pixel-plays

Add Rain Barrel: the playable page and its place in the catalogue, on the rules in `rain-barrel/gutter.js` #246

Merged opened this

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

Merged

Rain Barrel is now playable at /rain-barrel/ and listed in the catalogue; the branch is pushed on top of current main. The tests below pass.

Notes

shipped production is serving it deploy ab54f53

opened this

Rain Barrel is now playable at /rain-barrel/ and listed in the catalogue; the branch is pushed on top of current main. The tests below pass. scripts/gate.ts, scripts/fast.ts and scripts/design-lint.ts don't exist in this clone, and bun x tsc --noEmit printed only its help text because the repo has no tsconfig, so none of those checks ran.

What changed

  • The page: rain-barrel/index.html draws the cottage wall with five gutter spouts, the falling drops, the barrel and the yard puddle. It only calls gutter.js (start, move, tick, empty) and adds no game rule of its own.
  • Controls: tap a spout or press Left/Right to slide the barrel; tap the barrel or press Space/Enter/Down to empty it.
  • HUD: it shows ticks left, barrel fill, puddle level and score straight from the rules state, plus the rules' own status line.
  • Visual rules:

- The canvas is 360x280 at the fixed camera with hard shadows screen-right, and the puddle limit is a dashed red ring on the yard. - A full barrel wears a wooden lid with a knob. - Only the clouds drift ambiently, and they stop under prefers-reduced-motion. - The canvas aria-label says how to play, the rules popup is four lines, there is a #mute button, and no .mp3 is committed.

  • Catalogue: I added the GAMES entry with exactly the fields from the issue, the matching <li> in index.html, and the README Games row, no-music list and ambient-motion note. The town building comes from town.js laying out GAMES. I ran bun scripts/og.mjs, so og/rain-barrel.png and og/home.png are new.
  • Tests: rounds.mjs has a scripted round (the bot slides under the next spout and empties when full) that wins at seed 1 in about 16 s. An untouched game does not reach "Yard dry". serve.test.mjs asserts that /rain-barrel/ and /rain-barrel/gutter.js answer 200.
  • Test results: serve, shell and town tests, the rain-barrel rules tests, and the rain-barrel playtests all pass. I did not run the full bun test; the forge runs it on the push.

Choices

  • A tick lasts 0.5 s with a 0.8 s lead-in before the first drop. That is a presentation choice; the rules count only ticks.
  • Emptying resolves its two rain ticks at once. The page restarts the tick timer rather than animating them.
  • The scene looks small on the page because the engine's scale is fixed. I did not add a zoom.
  • No new dependencies, and nothing in the repository's content asked for anything outside this task.

To try it Run node serve.mjs and open /rain-barrel/. Keep the puddle under the red ring for the 40 ticks.

🤖 Generated with Claude Code

Closes #220

2 earlier comments · 1 event
commented

Rain Barrel is now playable at /rain-barrel/ and listed in the catalogue; the branch is pushed on top of current main. The tests below pass. scripts/gate.ts, scripts/fast.ts and scripts/design-lint.ts don't exist in this clone, and bun x tsc --noEmit printed only its help text because the repo has no tsconfig, so none of those checks ran.

What changed

  • The page: rain-barrel/index.html draws the cottage wall with five gutter spouts, the falling drops, the barrel and the yard puddle. It only calls gutter.js (start, move, tick, empty) and adds no game rule of its own.
  • Controls: tap a spout or press Left/Right to slide the barrel; tap the barrel or press Space/Enter/Down to empty it.
  • HUD: it shows ticks left, barrel fill, puddle level and score straight from the rules state, plus the rules' own status line.
  • Visual rules:

- The canvas is 360x280 at the fixed camera with hard shadows screen-right, and the puddle limit is a dashed red ring on the yard. - A full barrel wears a wooden lid with a knob. - Only the clouds drift ambiently, and they stop under prefers-reduced-motion. - The canvas aria-label says how to play, the rules popup is four lines, there is a #mute button, and no .mp3 is committed.

  • Catalogue: I added the GAMES entry with exactly the fields from the issue, the matching <li> in index.html, and the README Games row, no-music list and ambient-motion note. The town building comes from town.js laying out GAMES. I ran bun scripts/og.mjs, so og/rain-barrel.png and og/home.png are new.
  • Tests: rounds.mjs has a scripted round (the bot slides under the next spout and empties when full) that wins at seed 1 in about 16 s. An untouched game does not reach "Yard dry". serve.test.mjs asserts that /rain-barrel/ and /rain-barrel/gutter.js answer 200.
  • Test results: serve, shell and town tests, the rain-barrel rules tests, and the rain-barrel playtests all pass. I did not run the full bun test; the forge runs it on the push.

Choices

  • A tick lasts 0.5 s with a 0.8 s lead-in before the first drop. That is a presentation choice; the rules count only ticks.
  • Emptying resolves its two rain ticks at once. The page restarts the tick timer rather than animating them.
  • The scene looks small on the page because the engine's scale is fixed. I did not add a zoom.
  • No new dependencies, and nothing in the repository's content asked for anything outside this task.

To try it Run node serve.mjs and open /rain-barrel/. Keep the puddle under the red ring for the 40 ticks.

🤖 Generated with Claude Code

Changes requested — before the latest push

Playable and served (200 on /rain-barrel/ and /rain-barrel/gutter.js in the preview), catalogue, README, og cards, rounds and serve test are all in place. One change to make before it lands:

  1. Fix first: the status line is a polite live region that is rewritten every 0.5 s. P.line is 'Tick N of 40: barrel ..., puddle ..., N points' and changes each tick, so a screen reader is told a new sentence twice a second for the whole round and cannot hear anything else. Drop aria-live from the per-tick text. Keep it only for the events (notes such as 'Barrel tipped out', the end line, 'the puddle floods'), for example by writing those to a separate role=status element and keeping the per-tick line as plain text.

Smaller, same round if easy: the 'of 4 in the barrel' and 'of 8 in the puddle' labels are hard-coded in the HTML; set them from P.capacity and P.limit so the HUD cannot drift from the rules.

No other box misses were found; once the live region is fixed the boxes below are met.

commented

Both of juniper's points are fixed on the same branch and pushed. serve.test.mjs (74 tests) and the rain-barrel playtests (6) pass; I did not run the full bun test.

  • Live region: the per-tick line (P.line, "Tick N of 40: …") now goes into a plain #line div with no live role. Only #status (role=status, aria-live=polite) is announced, and it carries event notes such as "Barrel tipped out" and the end line. #status is cleared when a note expires. The end line still matches the scripted round's outcome.
  • HUD labels: renderHud now sets "of N in the barrel" and "of N in the puddle" from P.capacity and P.limit.
  • Share cards: I re-ran bun scripts/og.mjs; the cards came out unchanged.
  • Disagreements: none.

I did not add a separate announcement for the puddle flooding, because the end line already says "Yard flooded: … puddle reached 8".

commented

I merged main into this branch and pushed. The merge now applies cleanly, and the forge's check will run on the push.

Conflicts. Rain Barrel and Patchwork Quilt were each added to the same lists in README.md, index.html, shell.js and serve.test.mjs. I kept both in every one. In the README's "Add a game" sentence about games without a music track, the list now reads "Bunting, Patchwork Quilt and Rain Barrel". The reduced-motion line now names both Patchwork Quilt's curtain and Rain Barrel's clouds. In serve.test.mjs both games keep their own "served without a track" test.

og/home.png. This is a binary file, so I didn't merge it by hand. I re-ran bun scripts/og.mjs, which regenerated every card and tag, including the home grid with both games.

Tests. bun test passes on serve.test.mjs, the shell tests, the Rain Barrel and Quilt tests, and playtest.test.mjs: 479 tests in all, none failing. I did not run the full suite, so the forge's check is its first run. There is no scripts/gate.ts here. bun x tsc --noEmit printed only tsc's help text, so I have no type-check result to report.

Approved

Both earlier asks are met: the per-tick line is a plain div and only #status is a live region, and the HUD labels come from P.capacity and P.limit. The preview serves /rain-barrel/ with 200. Next: (1) Non-blocking: announce the flood in the live region the moment the puddle hits the line, not only in the end line. (2) Non-blocking: add a visible focus ring on the canvas, which currently has outline:none.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs