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

Migrated from github.com/amirmushichge/pixel-plays

Add Tea Party: the playable page and its place in the catalogue, on the rules in `tea-party/table.js` #302

opened this

Merged 32d 7h ago, live in production

Tea Party is playable at /tea-party/ and listed in the catalogue. I tested it with the new page tests, the scripted round, serve.test.mjs, shell.test.mjs and town.test.mjs. Last run after the rebase, those passed apart from shell.test.mjs and town.test.mjs, which I did not rerun then.

Notes

opened this

Tea Party is playable at /tea-party/ and listed in the catalogue. I tested it with the new page tests, the scripted round, serve.test.mjs, shell.test.mjs and town.test.mjs. Last run after the rebase, those passed apart from shell.test.mjs and town.test.mjs, which I did not rerun then. I did not run the whole bun test.

What changed

  • Page: tea-party/index.html draws a gingham-clothed garden table with 2–5 guests, a round teapot, a tall copper coffee pot, a milk jug, a sugar bowl and a cake stand. Guests differ by hat (top hat, boater, sun hat, bobble hat, party hat) as well as colour. While orders are shown, each guest's bubble appears in turn, using small icons for drink, milk, sugars and cake.
  • Serving: tap a guest, then pot, milk, sugar (each tap adds one) and cake (each tap changes it), then the guest again to serve. Tab, arrows and Enter do the same; Tab leaves the canvas at either end.
  • Rules and HUD: the page drives the game only through tea-party/table.js. The HUD shows round, guests, score, wrong parts, perfect cups, best score and the cup being poured. Every move, and each order as it is shown, goes to the aria-live status.
  • Visual rules: 360x280 canvas, fixed camera, hard shadows screen-right. Grass and tree sway stops under prefers-reduced-motion, there is a #mute button, no .mp3, and the rules popup is four lines. The page repaints only when something changed, so the scripted round costs about 1.3 s.
  • Catalogue: shell.js has the GAMES entry exactly as specified, the index.html <li>, the README Games table row and the without-music list. The town draws its building from GAMES, so town.js needed no edit. bun scripts/og.mjs has been run.
  • Tests: rounds.mjs has a scripted round that serves all 14 guests perfectly and reaches the win line. serve.test.mjs asserts /tea-party/ and /tea-party/table.js answer 200. tea-party/page.test.mjs is new and has 7 tests covering the bubbles in turn, serving by taps and by keys, an unfinished cup, losing and restarting, mute, and page-source checks.

Things to know

  • A serve that clears a round starts the next one with last: null. The page then works out how that cup went from the score and perfect-count change, using M.PART_POINTS and M.PERFECT_BONUS. A small change in table.js to keep last would be cleaner; I left the rules alone.
  • Pots and milk cast no shadow onto the cloth except a darker patch I paint by hand. Guests and the table do cast engine shadows onto the ground.
  • The scene looks small on the canvas. That is the engine's fixed scale, so I tightened the seating instead of changing it.
  • scripts/gate.ts, scripts/fast.ts and scripts/design-lint.ts do not exist in this repository, so none ran. bun x tsc --noEmit only printed usage because there is no tsconfig.

To try it: open /tea-party/, listen to the bubbles, then serve from memory. Locally, bun test tea-party and bun test playtest.test.mjs -t tea-party cover it.

🤖 Generated with Claude Code

Closes #278

commented

Tea Party is playable at /tea-party/ and listed in the catalogue. I tested it with the new page tests, the scripted round, serve.test.mjs, shell.test.mjs and town.test.mjs. Last run after the rebase, those passed apart from shell.test.mjs and town.test.mjs, which I did not rerun then. I did not run the whole bun test.

What changed

  • Page: tea-party/index.html draws a gingham-clothed garden table with 2–5 guests, a round teapot, a tall copper coffee pot, a milk jug, a sugar bowl and a cake stand. Guests differ by hat (top hat, boater, sun hat, bobble hat, party hat) as well as colour. While orders are shown, each guest's bubble appears in turn, using small icons for drink, milk, sugars and cake.
  • Serving: tap a guest, then pot, milk, sugar (each tap adds one) and cake (each tap changes it), then the guest again to serve. Tab, arrows and Enter do the same; Tab leaves the canvas at either end.
  • Rules and HUD: the page drives the game only through tea-party/table.js. The HUD shows round, guests, score, wrong parts, perfect cups, best score and the cup being poured. Every move, and each order as it is shown, goes to the aria-live status.
  • Visual rules: 360x280 canvas, fixed camera, hard shadows screen-right. Grass and tree sway stops under prefers-reduced-motion, there is a #mute button, no .mp3, and the rules popup is four lines. The page repaints only when something changed, so the scripted round costs about 1.3 s.
  • Catalogue: shell.js has the GAMES entry exactly as specified, the index.html <li>, the README Games table row and the without-music list. The town draws its building from GAMES, so town.js needed no edit. bun scripts/og.mjs has been run.
  • Tests: rounds.mjs has a scripted round that serves all 14 guests perfectly and reaches the win line. serve.test.mjs asserts /tea-party/ and /tea-party/table.js answer 200. tea-party/page.test.mjs is new and has 7 tests covering the bubbles in turn, serving by taps and by keys, an unfinished cup, losing and restarting, mute, and page-source checks.

Things to know

  • A serve that clears a round starts the next one with last: null. The page then works out how that cup went from the score and perfect-count change, using M.PART_POINTS and M.PERFECT_BONUS. A small change in table.js to keep last would be cleaner; I left the rules alone.
  • Pots and milk cast no shadow onto the cloth except a darker patch I paint by hand. Guests and the table do cast engine shadows onto the ground.
  • The scene looks small on the canvas. That is the engine's fixed scale, so I tightened the seating instead of changing it.
  • scripts/gate.ts, scripts/fast.ts and scripts/design-lint.ts do not exist in this repository, so none ran. bun x tsc --noEmit only printed usage because there is no tsconfig.

To try it: open /tea-party/, listen to the bubbles, then serve from memory. Locally, bun test tea-party and bun test playtest.test.mjs -t tea-party cover it.

🤖 Generated with Claude Code

commented

All four review items are done and pushed to the same branch. The Tea Party tests, the Tea Party playtest and serve.test.mjs pass here. I did not rerun shell.test.mjs or town.test.mjs, or look at the page on a phone.

  1. Dead state: G.heard is gone, from the state object and from begin().
  2. PINK_RGB(): deleted, and the teapot knob uses an inline [201, 138, 160].
  3. last on a round-clearing serve: tea-party/table.js now keeps last (the cup just served) when a serve starts the next round. table.test.mjs has a new test for it. serveGuest in the page reads P.last directly, and the code that worked out matched parts from score deltas and M.PART_POINTS/M.PERFECT_BONUS is removed.
  4. #scores block: I folded it into two lines plus the cup line, with the rows flowing in one flex-wrap block. The first line reads round, guests, points. The second reads wrong parts, perfect and best. The cup line only shows while a guest is selected. This takes about 3 lines instead of 7 over the top-left of the canvas. On a portrait phone the canvas is centred and sits below the old block anyway. On a short landscape screen the two lines still overlay the canvas's top-left corner, but only the cup line grows when a guest is selected.

I did not touch rounds.mjs; the scripted round still reaches the win line.

🤖 Generated with Claude Code

Sign in to join this conversation.

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

Keyboard shortcuts

Docs