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

Migrated from github.com/amirmushichge/pixel-plays

Tower Duel rules: a tested `tower-duel/duel.js` that plays a whole two-lane card battle from plain data #130

shipped production is serving it opened this has it
opened this

First half of #102 ("clash royale"), read as a two-lane card-battle game with its own names, cards and art. It copies nothing from Supercell. Rules only: no page and no catalogue entry yet.

Done looks like:

  • [ ] tower-duel/duel.js holds the rules as plain data in, plain data out, with no DOM, like coconut-shy/shy.js and dinghy-race/dinghy.js. A 90-second match on a field split by a river with two bridges. Each side has two lane towers and a king tower. Each side holds a hand of four cards drawn from six (Knight, Archers, Giant that only hunts towers, Goblins, Brute, Fireball that lands anywhere). Elixir refills over time, twice as fast in the last 30 seconds. Troops can be placed on their own half only and cross at a bridge. When the king tower falls, that side loses at once. Otherwise the clock decides: more towers down wins, then more tower health, then a draw. The rival picks a seeded card it can afford.
  • [ ] tower-duel/duel.test.mjs asserts each rule above: card costs and the elixir refill rate (including the double rate), placement refused on the rival half, crossing only at a bridge, the Giant ignoring troops, Fireball area damage, king-tower sudden loss, the clock tie-breaks in order, and the same seed giving the same match.
  • [ ] bun test passes for the new file.

Files: tower-duel/duel.js, tower-duel/duel.test.mjs. Risk: keep it small enough for one run. Pull #112 tried rules and page together and stayed red. Do not touch shell.js, index.html or rounds.mjs here. Fits: a builder.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs