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

Migrated from github.com/amirmushichge/pixel-plays

Add Lock Keeper: the playable page and its place in the catalogue, on the rules in `lock-keeper/lock.js` #159

Merged opened this

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

Merged

Lock Keeper is now playable at /lock-keeper/, built on lock-keeper/lock.js and listed in the catalogue. The five Lock Keeper playtests pass, as do serve.test.mjs and shell.test.mjs. I did not run the whole suite or bun x tsc --noEmit (the repo has no tsconfig), so the forge's check covers the rest.

Notes

shipped production is serving it deploy ab54f53

opened this

Lock Keeper is now playable at /lock-keeper/, built on lock-keeper/lock.js and listed in the catalogue. The five Lock Keeper playtests pass, as do serve.test.mjs and shell.test.mjs. I did not run the whole suite or bun x tsc --noEmit (the repo has no tsconfig), so the forge's check covers the rest. I rebased onto main before pushing, resolved README conflicts with newly merged games, and re-ran bun scripts/og.mjs afterwards.

What changed

  • The page: lock-keeper/index.html draws the seven places of the canal as a diorama on the 360×280 canvas, with the water level cut away at the front so you can read it. Gates are wooden beams, open gates swing back against the walls, paddles are posts that glow when drawn, and boats are red going up and blue coming down. Every operation goes through LockKeeper.apply, so the page adds no rule of its own.
  • Input: Tap a gate, paddle or boat, or press Left and Right to pick a lock and 1 to 5 for top paddle, bottom paddle, top gate, bottom gate and move boat.
  • Refusals and HUD: A refusal shows the rules' reason code with a short explanation. The HUD shows R.ops and R.par, and the status line is R.line. After a win or a flood, any tap or key starts the next shipped seed.
  • Visual rules: Water, boats and rising levels are eased towards the rules' state for the eye only. The water ripple is the only ambient motion and stops under prefers-reduced-motion. The canvas aria-label says how to play, the rules popup is three lines, there is a #mute button, and no .mp3.
  • Catalogue:

- shell.js has the GAMES entry exactly as specified. - The root index.html has the matching <li>. - The README has the Games table row, the no-music list and the ambient-motion line. - og/lock-keeper.png and og/home.png are regenerated.

  • Tests:

- serve.test.mjs asserts /lock-keeper/ and /lock-keeper/lock.js answer 200. - rounds.mjs has a scripted round that finds a shortest winning sequence with a breadth-first search over the rules' own apply, then plays it through the Left/Right and number keys. It reaches "All N boats through in N operations".

Left out

  • No best-score storage.
  • No per-boat "done" marker, since that would mean re-deriving a rule.
  • Taps on empty water do nothing.

Try it: bun serve.mjs, then open /lock-keeper/. Try 1 then 3 on lock 1: the top paddle fills the lock and the top gate then opens. 4 on a low lock is refused with gate-open if the far gate is open.

Closes #141

Approved

Lock Keeper is reachable from the home list, the menu and the no-JS fallback. The preview serves /lock-keeper/ with a 200. It runs on the tested rules in lock.js. Keyboard play (Left/Right, 1-5) works, refusals are worded for a person, the status is a live region, and the README and the serve and rounds playtests cover it. Two things to do next: 1) give the canvas a text alternative that updates with state (boats waiting, which gates are open), since the status line only announces the last action. 2) check the paddle tap targets on a 360px phone: the rectOf pad of 4 px in canvas space may be under about 44 CSS px, so consider enlarging it.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs