Public: anyone can read this; the crew can change it.
Migrated from github.com/amirmushichge/pixel-plays
clash royale #112
Parked 31d 3h ago
Issue #102 was empty apart from the title, so I read "clash royale" as a request for a two-lane card-battle game. I added it as a new game, Tower Duel, at tower-duel/. It has its own names, cards and pixel art and copies nothing from Supercell.
-
Reviews
No review yet.
-
Checks
stopped parked by the crew deploy 3f01261
-
History
- Merge main into mason/102-clash-royale 3f01261
- Fix the suite after the merge: scripted rounds for four games, firefly-jar stops text selection, page tests read state through the playtest harness ad7b879
- Add Sheepdog: guide the flock through the gate and into the pen before the light goes (#93) 6f1ec61
- Add Tower Duel: send troops across the bridges at the rival's towers with elixir and a hand of four cards (#102) 641ef06
- Add Firefly Jar: tap the glowing fireflies into a jar on a summer night before the moths put the lantern out (#90) 6db3d65
- From the app: pressing and holding i. mobile keeps highlighting and adding the iphone magni... (#89) de8d11a
- Playtests: a scripted round per game that reaches a win or a loss (#70) 89b614c
- Add Soapbox Derby: steer a wooden cart down a cobbled hill between the hay bales (#80) 4512fea
- Add Signal Box: repeat the lever sequence to route each train through a country junction (#79) 6436bd8
- Add Espresso Bar: pour each coffee to the line as cups slide past under the spout (#71) 50e7872
- Add Wood Split: split logs on a chopping block by bringing the axe down on the crack (#67) 553ae24
- Add Goalkeeper: dive left or right to save ten penalties in a village football ground (#75) 8b54ed6
- Add Bell Tower: ring the peal back on four bells, one bell longer each round (#69) 8a3ca29
- Add Archery: ten arrows at a straw target, reading the wind off a pennant (#64) 8327827
- Add Tram Line: drive a city tram and stop each door on the yellow mark (#63) cf817a1
- Add Tightrope: walk a wire between two rooftops, leaning to keep your balance in the wind (#60) 93e1bbc
- games need to have a much higher playability standard. tests that actually pl… (#49) 8c0d92c
- Add Ice Fishing: drop a line through the ice and reel each fish up before the line snaps (#58) 07375f1
- Add Bread Oven: slide loaves into a wood-fired oven and pull each one out golden (#54) 9c2022a
- Add Beekeeper: smoke the hive calm and lift out honey frames before the bees swarm (#53) fd12dfd
3 earlier comments
Issue #102 was empty apart from the title, so I read "clash royale" as a request for a two-lane card-battle game. I added it as a new game, Tower Duel, at tower-duel/. It has its own names, cards and pixel art and copies nothing from Supercell. I only ran the Tower Duel tests, not the whole suite. The two failures in the playtest and serve suites that I saw are listed below as already on main. I didn't run bun scripts/design-lint.ts, and bun x tsc --noEmit prints only its usage text because the repo has no tsconfig. I also didn't try the game in a real browser.
How it plays
- The match lasts 90 seconds, with a river in the middle and two bridges.
- You hold a hand of four cards from six: Knight, Archers, Giant (only hunts towers), Goblins, Brute and a Fireball that lands anywhere.
- Each card costs elixir, which refills over time and twice as fast in the last 30 seconds.
- Troops go on your half only. They cross at a bridge, fight what they meet, and towers shoot back.
- If the king tower falls, that side loses at once. Otherwise the clock ends it: more towers down wins, then more tower health, then a draw.
- The rival picks a random card it can afford and plays a fireball only where troops are bunched.
- Wins are kept in
localStorage. - Input is tap a card, then tap your half; or
1–4or Tab to pick, arrows to move a ring, space to play.
Where it lives
tower-duel/duel.jsholds the rules as plain numbers with no DOM, likefirefly-jar/night.js.tower-duel/index.htmlholds the page. It draws straight to the pixel buffer and doesn't loadengine.js, because the engine is isometric 3D and this is a flat top-down arena.- I registered it in
shell.jsandindex.html, andscripts/og.mjsmadeog/tower-duel.pngand the home collage. The README has the row and the "no soundtrack" note. - I added a new
Strategykind, andserve.test.mjsnow allows it. - I added no dependencies.
Tests
duel.test.mjshas 14 tests: elixir, card cycling, refusals, bad input, bridge crossing, the Giant, fireball radius, towers, crowns, tie-breaks, restart and seed replay. Left alone you lose every time, and a simple bot that just keeps sending troops wins most matches.page.test.mjscovers tapping a card then the field, the rival-half refusal, the keyboard, and the end line.rounds.mjshas a scripted round. The shared playtests fortower-duelpass.
Already failing on main, not touched
playtest.test.mjs"every game has a scripted round" fails becauseespresso-bar,firefly-jar,signal-boxandsoapbox-derbyhave no entry inrounds.mjs.serve.test.mjs"turns off text selection and the iOS touch callout" fails forfirefly-jarand others that lack the CSS line. Tower Duel has it.
To try it
Run bun serve.mjs and open /tower-duel/, or use the preview once the forge builds this push.
Not done
- No music; it plays on its own sound effects.
- No unit collision, no elixir-drain or overtime rules, and the deck is fixed at six cards.
🤖 Generated with Claude Code
All 10 failing tests should pass now, but I haven't re-run the full suite. I ran the scripted rounds for the four games without one plus tower-duel, and the signal-box, soapbox-derby and serve.test.mjs suites, which passed (80 tests). I didn't re-run playtest.test.mjs end to end, because it takes longer than the shell's two-minute limit. I also didn't run bun x tsc --noEmit or scripts/gate.ts, and I touched no src/web/, so design-lint doesn't apply. The forge's check runs the full suite on this push.
None of the failures came from Tower Duel. They were gaps in the games merged to main just before it (Espresso Bar, Firefly Jar, Signal Box, Soapbox Derby) and a test helper that changed under them.
- Scripted rounds:
rounds.mjshad no entry forespresso-bar,firefly-jar,signal-boxorsoapbox-derby, which failed the "every game has a scripted round" check and each game's own round test. I added one per game, each ending in a loss:- Espresso Bar: leave the cups unpoured.
- Firefly Jar: idle until the third moth reaches the lantern.
- Signal Box: pull a wrong lever on purpose.
- Soapbox Derby: idle until the cart wrecks.
- Firefly Jar: its
index.htmlwas missing the no-text-selection and no-touch-callout CSS that every game page must have. I added it, copying Soapbox Derby's line. - Page tests:
signal-box/page.test.mjsandsoapbox-derby/page.test.mjsread game state withvm.runInContext, butplaytest.mjsnow keeps the page's variables out of the global scope. I switched them tog.read(...). These tests were wrong and needed the change; the games were fine.
Behaviour is unchanged and no dependencies were added.
I merged main into mason/102-clash-royale and pushed it. The scripted rounds for the games both sides touched pass, as do serve.test.mjs and the Tower Duel tests (66). I didn't run the full playtest.test.mjs or bun x tsc --noEmit; the forge's check runs the full suite on this push.
How I resolved the four conflicts:
rounds.mjs: I kept main's rounds for Espresso Bar, Firefly Jar, Signal Box and Soapbox Derby, plus its new Sheepdog round. They play each game properly, and mine only let the round run out. I dropped my four stand-in rounds. I kept the Tower Duel round, which main doesn't have.firefly-jar/index.html: I took main's version of the no-text-selection CSS, which is the same fix as mine in one line.README.md: I started from my side so the Tower Duel row stayed. I added main's Sheepdog row, main's updated "Ambient motion" bullet and main's "Add a game" paragraph, with Tower Duel added to the list of games that play on sound effects alone.og/home.png: I took main's copy and regenerated it withbun scripts/og.mjs, so it includes Sheepdog and Tower Duel. The script also re-rendered the other cards. I committed onlyog/home.pngandog/sheepdog.png.
Issue #102 was empty apart from the title, so I read "clash royale" as a request for a two-lane card-battle game. I added it as a new game, Tower Duel, at
tower-duel/. It has its own names, cards and pixel art and copies nothing from Supercell. I only ran the Tower Duel tests, not the whole suite. The two failures in the playtest and serve suites that I saw are listed below as already onmain. I didn't runbun scripts/design-lint.ts, andbun x tsc --noEmitprints only its usage text because the repo has no tsconfig. I also didn't try the game in a real browser.How it plays
localStorage.1–4or Tab to pick, arrows to move a ring, space to play.Where it lives
tower-duel/duel.jsholds the rules as plain numbers with no DOM, likefirefly-jar/night.js.tower-duel/index.htmlholds the page. It draws straight to the pixel buffer and doesn't loadengine.js, because the engine is isometric 3D and this is a flat top-down arena.shell.jsandindex.html, andscripts/og.mjsmadeog/tower-duel.pngand the home collage. The README has the row and the "no soundtrack" note.Strategykind, andserve.test.mjsnow allows it.Tests
duel.test.mjshas 14 tests: elixir, card cycling, refusals, bad input, bridge crossing, the Giant, fireball radius, towers, crowns, tie-breaks, restart and seed replay. Left alone you lose every time, and a simple bot that just keeps sending troops wins most matches.page.test.mjscovers tapping a card then the field, the rival-half refusal, the keyboard, and the end line.rounds.mjshas a scripted round. The shared playtests fortower-duelpass.Already failing on
main, not touchedplaytest.test.mjs"every game has a scripted round" fails becauseespresso-bar,firefly-jar,signal-boxandsoapbox-derbyhave no entry inrounds.mjs.serve.test.mjs"turns off text selection and the iOS touch callout" fails forfirefly-jarand others that lack the CSS line. Tower Duel has it.To try it Run
bun serve.mjsand open/tower-duel/, or use the preview once the forge builds this push.Not done
🤖 Generated with Claude Code
Closes #102