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

Migrated from github.com/amirmushichge/pixel-plays

Add Bowls Green: roll four biased woods to rest nearer the jack than the rival woods #144

Merged opened this

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

Merged

Bowls Green is added as a forged Sport game, mounted like the others. The listed tests pass and the branch is pushed, but I never loaded the page in a browser. I did not run the full bun test suite (the forge runs it on push).

Notes

shipped production is serving it deploy ab54f53

opened this

Bowls Green is added as a forged Sport game, mounted like the others. The listed tests pass and the branch is pushed, but I never loaded the page in a browser. I did not run the full bun test suite (the forge runs it on push).

What changed

  • Rules (bowls-green/bowls.js): step(wood, bias, pace, dt) is pure. It slows the wood by the pace every second and turns its heading towards the bias side at 0.2 / (speed + 0.5) rad/s, so the bend comes late and aiming straight at the jack misses on the bias side.
  • Weight to distance: a wood of weight w rests w² · reach(pace) away. The pace is a seeded constant per game (0.7–0.9 m/s²), and so is the bias side.
  • Dead woods: a wood that passes the back edge is dead. I also made one that leaves by the side into the ditch dead, which the issue didn't ask for.
  • End and scoring: one end is four woods against two resting rival woods, the nearest about 0.9 m from the jack. The count is the player's live woods strictly nearer the jack than the nearest rival. One or more wins ("You win: N wood(s) nearer the jack than the rival"); none loses.
  • Best: I took "best" to mean the most woods nearer the jack in one end, saved in localStorage. The HUD shows wood number, nearest distance in metres and best.
  • Tests (bowls-green/bowls.test.mjs): 17 tests cover the curve, the mirror symmetry, weight against distance, dead woods, the count and the win and loss lines. Beating the rivals is tested from a scripted line and weight for 20 seeds.
  • Page (bowls-green/index.html): 360x280 canvas, fixed camera, hard shadows screen-right, a #mute button, no .mp3, a three-line rules popup and a canvas aria-label that says how to play.
  • Controls: drag back from the mat sets weight along the green's axis and line sideways, and release rolls. Left/Right set the line in half degrees, and holding Space builds weight over 1.6 s.
  • Motion: only the hedge leaves stirring and a drifting cloud shadow, both stopped under prefers-reduced-motion.
  • Wiring:

- GAMES entry in shell.js as specified, with the matching <li> in the root index.html. - README Games table, the no-music list and the ambient-motion rule. - Two checks in serve.test.mjs. - A scripted round in rounds.mjs. - og/bowls-green.png and the share tags, from bun scripts/og.mjs. - og/home.png also changed, because the home card list changed.

  • Checks: bun test on bowls-green, serve.test.mjs, shell.test.mjs, stats.test.mjs and limits.test.mjs all pass. playtest.test.mjs passes for the new folder (I ran it filtered to bowls-green and "every game"). The repo has no scripts/gate.ts or scripts/fast.ts, and bun x tsc --noEmit printed only its usage text (no type errors reported).

What I chose not to do

  • No wood-on-wood or wood-on-jack collisions: woods pass through each other.
  • No dependencies.
  • No bowler figure, only the wood waiting on the mat.
  • No curved-path preview, so the player has to learn the bias.

How to try it: open /bowls-green/, or find it in the Sport group on the home page. Drag back and to the side opposite the bias, or use Left/Right and hold Space.

🤖 Generated with Claude Code

Closes #96

1 earlier comment · 1 event
commented

Bowls Green is added as a forged Sport game, mounted like the others. The listed tests pass and the branch is pushed, but I never loaded the page in a browser. I did not run the full bun test suite (the forge runs it on push).

What changed

  • Rules (bowls-green/bowls.js): step(wood, bias, pace, dt) is pure. It slows the wood by the pace every second and turns its heading towards the bias side at 0.2 / (speed + 0.5) rad/s, so the bend comes late and aiming straight at the jack misses on the bias side.
  • Weight to distance: a wood of weight w rests w² · reach(pace) away. The pace is a seeded constant per game (0.7–0.9 m/s²), and so is the bias side.
  • Dead woods: a wood that passes the back edge is dead. I also made one that leaves by the side into the ditch dead, which the issue didn't ask for.
  • End and scoring: one end is four woods against two resting rival woods, the nearest about 0.9 m from the jack. The count is the player's live woods strictly nearer the jack than the nearest rival. One or more wins ("You win: N wood(s) nearer the jack than the rival"); none loses.
  • Best: I took "best" to mean the most woods nearer the jack in one end, saved in localStorage. The HUD shows wood number, nearest distance in metres and best.
  • Tests (bowls-green/bowls.test.mjs): 17 tests cover the curve, the mirror symmetry, weight against distance, dead woods, the count and the win and loss lines. Beating the rivals is tested from a scripted line and weight for 20 seeds.
  • Page (bowls-green/index.html): 360x280 canvas, fixed camera, hard shadows screen-right, a #mute button, no .mp3, a three-line rules popup and a canvas aria-label that says how to play.
  • Controls: drag back from the mat sets weight along the green's axis and line sideways, and release rolls. Left/Right set the line in half degrees, and holding Space builds weight over 1.6 s.
  • Motion: only the hedge leaves stirring and a drifting cloud shadow, both stopped under prefers-reduced-motion.
  • Wiring:

- GAMES entry in shell.js as specified, with the matching <li> in the root index.html. - README Games table, the no-music list and the ambient-motion rule. - Two checks in serve.test.mjs. - A scripted round in rounds.mjs. - og/bowls-green.png and the share tags, from bun scripts/og.mjs. - og/home.png also changed, because the home card list changed.

  • Checks: bun test on bowls-green, serve.test.mjs, shell.test.mjs, stats.test.mjs and limits.test.mjs all pass. playtest.test.mjs passes for the new folder (I ran it filtered to bowls-green and "every game"). The repo has no scripts/gate.ts or scripts/fast.ts, and bun x tsc --noEmit printed only its usage text (no type errors reported).

What I chose not to do

  • No wood-on-wood or wood-on-jack collisions: woods pass through each other.
  • No dependencies.
  • No bowler figure, only the wood waiting on the mat.
  • No curved-path preview, so the player has to learn the bias.

How to try it: open /bowls-green/, or find it in the Sport group on the home page. Drag back and to the side opposite the bias, or use Left/Right and hold Space.

🤖 Generated with Claude Code

the crew's run was interrupted: restart, resumes on the next pass — cancelled
commented

Bowls Green is a new playable page (bowls-green/). You roll four biased woods to rest nearer the jack than the rival woods. The game is in the catalogue and has its scripted round in rounds.mjs. main is merged in and pushed.

Merge: the only change on main was Go-Kart Fete (#125). Git left no conflicts, and I checked that the Bowls Green and Go-Kart entries both survived in index.html, shell.js, rounds.mjs, serve.test.mjs and the README. The merge commit also regenerates og/home.png with both games on it.

Checks: I ran the Bowls Green tests plus serve.test.mjs and playtest.test.mjs after the merge. All 291 tests passed. bun x tsc --noEmit only printed the compiler help because the repo has no tsconfig, so it checked nothing. There is no scripts/gate.ts or scripts/fast.ts here, and I did not run the full suite. The forge runs the full check on this push.

To try it: open the home page, tap Bowls Green in the catalogue, or go straight to /bowls-green/.

Approved

Bowls Green is served in the preview: /bowls-green/, bowls.js and the share card all answer 200. It is a static game with no identity, writes or terminal, so the security and tty items do not apply. The rules are pure and tested (curve, mirror symmetry, weight to distance, dead woods, count and win/loss lines, 20 seeds beating the rivals). It is wired into the catalogue, shell, README, rounds.mjs and serve.test.mjs. It adds no dependency and no dead code. The page has a canvas label, keyboard control, a status live region and a no-JS explanation.

Two things I would do next:

  1. The mute button has a small hit area (10px padding, -10px margin). Give it a 44px target for a thumb on a 360px phone.
  2. Draw the wood-on-wood collisions the README says are skipped, or show a faint curved-path preview so a new player can learn the bias without wasting woods.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs