Repository navigation
v2.1.0
Nothing that was exported has changed; the rules, both maps and every saved game (kept version 2, export format 2) are exactly as they were. The dice and cards the table draws can now be Korokoro's and Toranpu's; by default they are drawn as before. This is a minor release (2.1.0).
Added
@johnmorrisdotca/tenka/dressing, a new entry:tenkaDressing(options?)makes aTenkaDressingthat draws the table's dice with Korokoro and its cards with Toranpu. The dice are Korokoro's, with pips, and tumble onto the faces the game threw (a die lands ontenkaThrownDie(face), the source Korokoro throws from) only when a move has just thrown them, never when the table is drawn again for another reason; a device that asks for reduced motion lands them at once, andsound: trueplays the sound of real dice once for each throw. Each card in hand is Toranpu's, drawn with its own territory's outline from the map, its name in the table's language, its region and the symbol of its army (a castle for land, a ship for sea, a plane for air); the wild cards show all three. The deck sits beside the hand face down, in Tenka's own back (TENKA_BACK: the table's green, with 天), with the number left in it. Also exported:tenkaCardDesign()(the cards as a Toranpu design namedtenka, for Toranpu's own elements),tenkaCardIdandtenkaCardOfId.dressingin the table's options, inmountTenka, on the ReactTenkaTableand as the<tenka-table>element'sdressingproperty; aTenkaDressingis{ die?, card?, back? }, each given what the game decided and returning the element to show, so a look of your own is a function. The types (TenkaDressing,TenkaDrawn,TenkaDieHow,TenkaCardHow,TenkaBackHow) are exported from/ui. A dressing only draws: the game is the same, move for move and dice for dice, dressed or plain, and a dressing that throws is replaced by the plain drawing. Every die carries its number asdata-face, and every carddata-cardanddata-territory, plain or dressed.- Three words in both languages (
dieAttack,dieDefend,deckLeft): "Attacker's die: 4" for a screen reader, and "Deck: 41" beside the deck. Two theme variables,--tk-die-sizeand--tk-card-width. - README: "Dice and cards from Korokoro and Toranpu", with a picture (
docs/dressed.jpg, taken bypnpm pictures); the demo's table is dressed, and?dressing=offshows the plain one.
Dependencies
@johnmorrisdotca/korokoro(1.15 or later) and@johnmorrisdotca/toranpu(2.14 or later) are optional peer dependencies, imported by/dressingand by nothing else. Tenka still has no dependencies: the rules, the map, saving, the computer player and the plain table (/ui,/react,/element) never import either, andpnpm test:packageinstalls the package without them and imports every other entry, then installs them and proves/dressing. Without them, importing/dressingfails naming the missing package. A page with no bundler needs an import map, as the demo's has.
Changed
- The demo's table is dressed (
?dressing=offfor the plain one), carrying the files of Korokoro and Toranpu it reaches undervendor/; the table in a tag stays plain. If they cannot be fetched the table is drawn plain. - The table's tests read the dice from
data-faceand not from the text of the line, and a newtable/dressed.table.mjschecks the dice against the numbers the game threw, each card against its territory's own outline and name, the deck, that a dressed and a plain table make the same game from the same taps, and that the dice tumble once.