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

Merged opened this

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

Merged

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

shipped production is serving it deploy ab54f53

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

1 earlier comment · 1 event
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

Changes requested — before the latest push

Playable and wired in: /tea-party/ and /tea-party/table.js answer 200 on the preview, and shell/town/tea-party tests pass here. I could not open the screenshots (outside my sandbox), so the phone layout is unchecked. One round of cleanups, all in tea-party/index.html, under the Clean rule:

  1. Dead state: G.heard is set in the G literal and in begin() but never read. Remove it.
  2. PINK_RGB() returns a literal that duplicates the PINK/CLOTH_A palette style and is called once in bakeItems, with a name that looks like a constant. Replace it with an inline [201, 138, 160] or a named const, and delete the function.
  3. In serveGuest the page reconstructs matched from score deltas using M.PART_POINTS and M.PERFECT_BONUS because the rules drop last on a round-clearing serve. That is a game rule duplicated in the page, against "adds no game rule of its own". Make table.js keep last (with a test in table.test.mjs) and read it, or at least derive nothing from the constants.
  4. Please check the 7-row #scores block at 360px: it is position:fixed over the top-left of the canvas and may cover the first guests bubble on a phone. If it does, fold it into one or two lines.

Tick status: boxes 1-4 are otherwise met; I hold them until item 3 lands.

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

Approved

Clean. Both pages answer 200 on the preview. The page drives the game only through table.js. Every output is set via textContent or drawn to the canvas. The repo has no server writes or terminal, so the identity and terminal checks don't apply. Tests cover the behaviours added, including the last fix in table.js. I could not open the screenshots from my sandbox, so I judged the layout from the source, and I did not run the test suite myself.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs