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

Migrated from github.com/amirmushichge/pixel-plays

Add Pottery Wheel: centre the clay and pull the tallest pot without tearing it #27

opened this

Merged 32d 20h ago, live in production

I merged main into this branch and pushed it. The merge conflicted in README.md, index.html and shell.js. The check that runs on the push hasn't reported yet.

Notes

opened this

I merged main into this branch and pushed it. The merge conflicted in README.md, index.html and shell.js. The check that runs on the push hasn't reported yet.

All three conflicts were the same thing: main added Row Home in the same spot where this branch added Pottery Wheel. I kept both games in the README table, the no-JS fallback list in index.html and the GAMES list in shell.js. The README's "Add a game" paragraph now names both Pottery Wheel and Row Home among the games that play on their own sound effects.

I ran serve.test.mjs, which covers the game pages and the fallback-list sync, and the Pottery Wheel and Row Home tests. All of them pass. I did not run the full suite, since the forge's check does that on push.

Continues #27

2 earlier comments
commented

Pottery Wheel is added at /pottery-wheel/. The new tests, serve.test.mjs and shell.test.mjs pass (27 tests); I didn't run bun test on the whole suite. I couldn't open the page in a browser here, so I rendered it headlessly through a stubbed canvas and looked at the frames. There's no tsc config, so I didn't run that.

What it does

  • Centring: hold to press (pointer or space). Pressure builds the longer you hold. Holding straight through collapses a wobbling lump, so you ease off and press again.
  • Pulling: once the clay is centred, drag up or hold the up arrow. Pulling too fast thins the wall until it tears, and too slow slumps it. A "fire the pot" button (or F) fires it early, and a pot also fires at 72 px.
  • Round: three pots per round. A collapsed or torn pot scores 0. A fired pot glows, then rides up to the shelf at its height. The score is the total height in pixels, with the best saved locally.
  • Scene: a kick wheel, a stool and a shelf with a plant. The plant stops swaying under prefers-reduced-motion. The clay is drawn in whole-pixel bands with a hard shadow screen-right. The canvas aria-label says how to play, and the rules popup is two short rules.
  • Rules and tests: the rules live in pottery-wheel/clay.js and are covered by pottery-wheel/clay.test.mjs. The tests show that steady pressure centres the clay, hard pressure on a wobbling lump collapses it, and a fast pull tears the wall.
  • Wiring: the game is listed in shell.js and the root index.html, and the README Games table has a row for it. The page has #mute and no .mp3. serve.test.mjs checks /pottery-wheel/ and clay.js answer 200.

What I chose not to do

  • No potter figure: the stool stands empty and the hands are simple blocks.
  • Shelf pots are drawn at half width but at their true height.
  • The drawn pot is 14 px taller than the scored height, because the lump itself is 14 px. The score counts only the pulled height.

Try it: bun serve.mjs, open /pottery-wheel/, hold space for about 0.7 s, release, and repeat until the status says it is centred. Then hold the up arrow in short bursts and press F to fire.

I haven't played it with real touch input, so the drag-to-rate mapping is the part to check first.

commented

I merged main into this branch and pushed it. The merge conflicted in README.md, index.html and shell.js. The check that runs on the push hasn't reported yet.

All three conflicts were the same thing: main added Row Home in the same spot where this branch added Pottery Wheel. I kept both games in the README table, the no-JS fallback list in index.html and the GAMES list in shell.js. The README's "Add a game" paragraph now names both Pottery Wheel and Row Home among the games that play on their own sound effects.

I ran serve.test.mjs, which covers the game pages and the fallback-list sync, and the Pottery Wheel and Row Home tests. All of them pass. I did not run the full suite, since the forge's check does that on push.

commented

I kept the 40-second limit and moved it into the tested rules in clay.js, so it no longer lives only in the page. The 31 tests (the three suites you ran, plus the new ones) pass, but I haven't loaded the page in a browser.

  • Rules: each pot now tracks the time spent on it in step, and TIME_LIMIT is exported. A pot still being centred when time runs out ends as dried, which counts as over and scores 0. A pull that runs out of time is fired as it stands. A pull still at 0 px also ends as dried, so nothing is fired as "0 px, into the kiln".
  • Page: the page-only timer and the collapsed fallback are gone. A dried pot now shows "the clay dried out, out of time" instead of blaming pressure. It crumples with the collapse animation.
  • Visible limit: the HUD has a "s left on this pot" row, and the limit is stated in the rules popup, the canvas aria-label and the README.
  • Early firing: the second popup rule now says to fire early with the "fire the pot" button or F.
  • Tests: three new tests in clay.test.mjs cover a centring pot drying out, a timed-out pull being fired (and a slumped one drying), and elapsed time counting only while the pot is being worked.
Sign in to join this conversation.

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

Keyboard shortcuts

Docs