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

Migrated from github.com/amirmushichge/pixel-plays

Add Egg Basket: slide the basket along the henhouse to catch eggs rolling off the roof before they crack #94

Parked opened this
Closed without merging

Egg Basket is added as /egg-basket/ and pushed. The new tests pass, along with serve.test.mjs, shell.test.mjs and the playtests for the new folder; I did not run the full bun test. What changed Game: a red henhouse with a tin roof and three hens on the ridge.

Notes

stopped parked by the crew deploy 7386960

opened this

Egg Basket is added as /egg-basket/ and pushed. The new tests pass, along with serve.test.mjs, shell.test.mjs and the playtests for the new folder; I did not run the full bun test.

What changed

  • Game: a red henhouse with a tin roof and three hens on the ridge. Eggs roll down one of four roof lanes and drop off the eave; the basket slides along the eave to catch them.
  • Rules: a brown egg scores 1 and a golden one 3. An egg that reaches the ground cracks, and three cracks end the round. Rolling speed steps up every ten eggs laid. The end line says "you win, the basket is full" at 25 or more, and "three eggs cracked" below that.
  • Rules module: all of this lives in egg-basket/basket.js with plain data in and out. basket.test.mjs has a test for each rule above, including the 25 threshold.
  • Reachability: the module states the minimum spawn-to-drop time and the time to cross three lanes. The speed cap keeps the minimum above that crossing time plus 200 ms, and a test catches the fastest egg in the far lane from the opposite end.
  • HUD: eggs caught, cracks left (as a number and dots) and best. "Eggs caught" counts points, so a golden egg adds 3; the README says so.
  • Input and look: Left and Right arrows (also A and D) move the basket one lane, and dragging slides it freely. The scene is 360x280 with the fixed camera and shadows to the right. Only the hens' heads and the basket straw move on their own, and both stop under reduced motion. The canvas aria-label says how to play, the rules popup is three lines, and there is a #mute button and no .mp3.
  • Wiring: added to GAMES in shell.js, index.html, the README games table, the README music-free list and the README visual rules. og/egg-basket.png and its share tags are generated, and serve.test.mjs checks both URLs answer 200.
  • Playtest: rounds.mjs has a scripted round for the new folder. A bot follows the next egg with the arrow keys until 25 are caught, then lets three crack. An idle twin never reaches "you win".

What I chose not to do

  • No hen laying animation, and no shadows from the hens or rolling eggs (the engine casts shadows onto the ground only). Falling eggs and the basket do cast one.
  • No new dependency.

Checks I could not run

  • scripts/gate.ts, scripts/fast.ts and scripts/design-lint.ts don't exist in this clone.
  • bun x tsc --noEmit only printed its help text because there is no tsconfig.json, so it is not a real type check here.

To try it Run node serve.mjs and open /egg-basket/, or use the PR preview.

Closes #84

3 earlier comments
commented

Egg Basket is added as /egg-basket/ and pushed. The new tests pass, along with serve.test.mjs, shell.test.mjs and the playtests for the new folder; I did not run the full bun test.

What changed

  • Game: a red henhouse with a tin roof and three hens on the ridge. Eggs roll down one of four roof lanes and drop off the eave; the basket slides along the eave to catch them.
  • Rules: a brown egg scores 1 and a golden one 3. An egg that reaches the ground cracks, and three cracks end the round. Rolling speed steps up every ten eggs laid. The end line says "you win, the basket is full" at 25 or more, and "three eggs cracked" below that.
  • Rules module: all of this lives in egg-basket/basket.js with plain data in and out. basket.test.mjs has a test for each rule above, including the 25 threshold.
  • Reachability: the module states the minimum spawn-to-drop time and the time to cross three lanes. The speed cap keeps the minimum above that crossing time plus 200 ms, and a test catches the fastest egg in the far lane from the opposite end.
  • HUD: eggs caught, cracks left (as a number and dots) and best. "Eggs caught" counts points, so a golden egg adds 3; the README says so.
  • Input and look: Left and Right arrows (also A and D) move the basket one lane, and dragging slides it freely. The scene is 360x280 with the fixed camera and shadows to the right. Only the hens' heads and the basket straw move on their own, and both stop under reduced motion. The canvas aria-label says how to play, the rules popup is three lines, and there is a #mute button and no .mp3.
  • Wiring: added to GAMES in shell.js, index.html, the README games table, the README music-free list and the README visual rules. og/egg-basket.png and its share tags are generated, and serve.test.mjs checks both URLs answer 200.
  • Playtest: rounds.mjs has a scripted round for the new folder. A bot follows the next egg with the arrow keys until 25 are caught, then lets three crack. An idle twin never reaches "you win".

What I chose not to do

  • No hen laying animation, and no shadows from the hens or rolling eggs (the engine casts shadows onto the ground only). Falling eggs and the basket do cast one.
  • No new dependency.

Checks I could not run

  • scripts/gate.ts, scripts/fast.ts and scripts/design-lint.ts don't exist in this clone.
  • bun x tsc --noEmit only printed its help text because there is no tsconfig.json, so it is not a real type check here.

To try it Run node serve.mjs and open /egg-basket/, or use the PR preview.

commented

I merged main into the branch and pushed it, but the full check will probably still fail, on two Firefly Jar problems that are on main itself.

  • The failures: I ran serve.test.mjs, shell.test.mjs, the egg-basket tests and the playtests for egg-basket and firefly-jar.

- serve.test.mjs "every game page turns off text selection and the iOS touch callout" fails because firefly-jar/index.html is missing -webkit-touch-callout: none. origin/main has the same gap. - playtest.test.mjs fails for firefly-jar because rounds.mjs has no scripted round for it; ROUNDS['firefly-jar'] is undefined on main. The "every game has a scripted round" test also reports this.

  • What I left alone: I did not fix either Firefly Jar problem here, because they are in another pull's game. Every test for egg-basket passes after the merge. The fix for Firefly Jar is one CSS line plus a scripted round; say if you want me to add them to this pull.
  • Conflicts:

- In shell.js, index.html and the README games table, I kept both the Egg Basket and Firefly Jar entries. - In the README list of games without music, the sentence now reads "Soapbox Derby, Firefly Jar and Egg Basket play on their own sound effects". - For og/home.png I took main's version and re-ran bun scripts/og.mjs, so the grid has both games and the cards are regenerated.

commented

The preview failed because main had four games with no scripted playtest round: espresso-bar, firefly-jar, signal-box and soapbox-derby. The test requires one per game folder, so it failed on any branch. I added those four rounds to rounds.mjs and pushed.

I ran the playtests for espresso-bar, firefly-jar, signal-box and soapbox-derby, plus the "every game has a scripted round" check, and they pass. serve.test.mjs, shell.test.mjs and the egg-basket and firefly-jar tests pass too. I did not run the full suite; I'm relying on the forge's check for that.

The four scripted rounds:

  • espresso-bar: holds the pour until the fill reaches the line less what the falling stream still adds. It ends on "twenty cups poured".
  • firefly-jar: taps each moth so none reaches the lantern, and the night runs its ninety seconds out.
  • signal-box: pulls the wrong lever every time, so three lost trains end the game with 0 routed.
  • soapbox-derby: steers through the middle of the next gate's gap and reaches the banner.

I also added the missing -webkit-touch-callout: none line to firefly-jar/index.html. A serve.test.mjs check on every game page was failing for it, here and on main.

These fixes are not part of Egg Basket, so if another open pull adds the same rows you may get a small conflict in rounds.mjs to resolve.

commented

Parked by the crew: the check stayed red through 2 automatic tries

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs