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

Migrated from github.com/amirmushichge/pixel-plays

Add Row Home: race a rowing boat across the river by stroking in rhythm #25

Merged opened this

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

Merged

Row Home is added as a new game at row-home/, and the branch is pushed. bun test passes for the Row Home model, serve.test.mjs and shell.test.mjs. I didn't run the full suite.

Notes

shipped production is serving it deploy ab54f53

opened this

Row Home is added as a new game at row-home/, and the branch is pushed. bun test passes for the Row Home model, serve.test.mjs and shell.test.mjs. I didn't run the full suite. bun x tsc --noEmit printed only the compiler help text, so it never ran a check. scripts/design-lint.ts doesn't exist in this clone, so I couldn't run it.

I couldn't run a real browser (Chromium won't start in this sandbox). I ran the page script against a stubbed DOM for about 500 to 1,500 frames with no errors, at about 1.5 ms per frame. I also looked at two rendered frames. Nobody has tried it with a real finger or keyboard, or checked the sound or the reduced-motion behaviour.

What changed

  • Rules are in row-home/model.js as plain data in and out. A stroke that comes 0.8 to 1.5 s after the last one is in rhythm and surges the boat. Consecutive in-rhythm strokes build a streak that adds speed.
  • Crab and late strokes: a stroke before 0.8 s catches a crab: the boat nearly stops and ignores strokes for 1 s. A stroke after 1.5 s is a plain pull that drops the streak.
  • Steering and finish: a slow sinusoidal cross-current pushes the boat sideways, and holding left or right steers against it. The race is 24 units from jetty to jetty against a deterministic bot. The finish gives a time and a best.
  • Pacing: rowing a stroke every 1 s finishes in about 19.6 s and beats the bot at about 20.3 s. Stroking every 0.4 s doesn't finish within 90 s.
  • Page: row-home/index.html has a river with a jetty at each end, a finish flag, a lane rope of buoys, reeds that sway, your red boat and the yellow bot boat. Ripples and the wake are drawn in whole pixels, and both stop under prefers-reduced-motion.
  • Input: tap or space strokes. A tap on the left or right half of the canvas steers that way while held. Arrow keys or A/D also steer. The canvas aria-label explains how to play and the rules popup has four items.
  • Registration: the game is in GAMES in shell.js with music: false, forged: true, in the README Games table, in the no-JS fallback list in index.html (which serve.test.mjs requires), and in serve.test.mjs for /row-home/ and its model.js. No .mp3 is committed.
  • Tests: row-home/model.test.mjs has ten tests, including an in-rhythm stroke beating an early one and a race having a finish time.

What I chose not to do

  • No boat-to-boat collision: the bot stays in its own lane, behind the buoy rope. The edge of your lane (the rope on one side, the bank on the other) slows you instead.
  • No dependencies and no music, only a few synthesised splash sounds.

To try it: run node serve.mjs and open http://127.0.0.1:5300/row-home/.

Closes #13

commented

Row Home is added as a new game at row-home/, and the branch is pushed. bun test passes for the Row Home model, serve.test.mjs and shell.test.mjs. I didn't run the full suite. bun x tsc --noEmit printed only the compiler help text, so it never ran a check. scripts/design-lint.ts doesn't exist in this clone, so I couldn't run it.

I couldn't run a real browser (Chromium won't start in this sandbox). I ran the page script against a stubbed DOM for about 500 to 1,500 frames with no errors, at about 1.5 ms per frame. I also looked at two rendered frames. Nobody has tried it with a real finger or keyboard, or checked the sound or the reduced-motion behaviour.

What changed

  • Rules are in row-home/model.js as plain data in and out. A stroke that comes 0.8 to 1.5 s after the last one is in rhythm and surges the boat. Consecutive in-rhythm strokes build a streak that adds speed.
  • Crab and late strokes: a stroke before 0.8 s catches a crab: the boat nearly stops and ignores strokes for 1 s. A stroke after 1.5 s is a plain pull that drops the streak.
  • Steering and finish: a slow sinusoidal cross-current pushes the boat sideways, and holding left or right steers against it. The race is 24 units from jetty to jetty against a deterministic bot. The finish gives a time and a best.
  • Pacing: rowing a stroke every 1 s finishes in about 19.6 s and beats the bot at about 20.3 s. Stroking every 0.4 s doesn't finish within 90 s.
  • Page: row-home/index.html has a river with a jetty at each end, a finish flag, a lane rope of buoys, reeds that sway, your red boat and the yellow bot boat. Ripples and the wake are drawn in whole pixels, and both stop under prefers-reduced-motion.
  • Input: tap or space strokes. A tap on the left or right half of the canvas steers that way while held. Arrow keys or A/D also steer. The canvas aria-label explains how to play and the rules popup has four items.
  • Registration: the game is in GAMES in shell.js with music: false, forged: true, in the README Games table, in the no-JS fallback list in index.html (which serve.test.mjs requires), and in serve.test.mjs for /row-home/ and its model.js. No .mp3 is committed.
  • Tests: row-home/model.test.mjs has ten tests, including an in-rhythm stroke beating an early one and a race having a finish time.

What I chose not to do

  • No boat-to-boat collision: the bot stays in its own lane, behind the buoy rope. The edge of your lane (the rope on one side, the bank on the other) slows you instead.
  • No dependencies and no music, only a few synthesised splash sounds.

To try it: run node serve.mjs and open http://127.0.0.1:5300/row-home/.

Approved

Reviewed at e5677d8, the same head as the preview: /row-home/ matches the branch byte for byte apart from the forge toolbar. /, /row-home/ and /row-home/model.js all answer 200, and the home page lists Row Home with the 'Game forged by the crew' note.

  • Direction: this is a new game, and it is marked forged: true in GAMES, in the README table and in the no-JS fallback list. That keeps the original creators' credit on their own games and keeps it off this one, which is what the direction asks.
  • Rules: row-home/model.js is plain state in and state out. The ten tests cover the start, glide, rhythm against crab, the stall and its recovery, the streak, steering against the current, the rope and bank clamp, the finish and best time, and both the in-rhythm win and the early-stroke loss against the bot. Each test would fail if its rule were missing. bun test row-home serve.test.mjs shell.test.mjs gives 25 pass and 0 fail, three runs in a row.
  • Page: every engine global it uses exists in engine.js (dynamicAdd, drawDots, drawArrow, STILL, WIND_FPS, KIND_GRASS, and the tufts shape). Boot, resize and bake follow the same pattern as Sled Run and Harbour Crane.
  • Security, terminal and second door: this repository is a stateless static games site with no identity, no writes and no tty. Nothing here applies, the same as for the earlier forged games. The only stored value is the best time in localStorage, and the page reads it with a fallback.
  • Clean: there is no new dependency, no dead or commented-out code, and the README is updated in both places.

Non-blocking, for a later pass: on touch every tap also steers toward the half that was pressed, so you cannot stroke without nudging the boat sideways. A centre dead zone, say the middle third, would separate the two.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs