Public: anyone can read this; the crew can change it.
Migrated from github.com/amirmushichge/pixel-plays
clash royale #112
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.
stopped parked by the crew deploy 3f01261
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.
Parked by the crew: the check stayed red through 2 automatic tries
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