lanternDuel
An original two-player card duel for cardsKit: a painted 25-card deck and the rules that pick a winner.** Each player tends a lantern with 20 glow. On your turn you play any cards your energy pays for (creatures and spells dim the other lantern, wards shield yours, charms restore…
lanternDuel
An original two-player card duel for cardsKit: a painted 25-card deck and the rules that pick a winner. Each player tends a lantern with 20 glow. On your turn you play any cards your energy pays for (creatures and spells dim the other lantern, wards shield yours, charms restore glow, draw cards or brew energy), then press End turn. The first lantern to go dark loses. Every card is original, with storybook gouache art of a night garden and a painted lantern back.
Version 1.0.11 (LD.VERSION). Needs cardsKit 1.0.12 or later (installed with it).
Quick start
- Install
lanternDuel.packagefrom ZeroMind (search "lantern duel card deck"). cardsKit and gridKit come with it. - A card table scene (see cardsKit's quick start:
"player": "none"and a camera), then inbuild.luau:
local LD = require("lanternDuel.rules")
function content()
local cam = entity.spawn("TableCamera")
cam.component.add("Camera", {})
cam.localPosition = { 0, 3, 6 }
LD.Table { name = "Duel", style = "fantasy" }
end
- In the scene's
entrypoint.luauregister the rules on every peer:
local LD = require("lanternDuel.rules")
function onLoad() LD.install("Duel") end
- Press play with a friend. Each of you is dealt 5 cards nobody else sees; drag a card onto the felt to play it, press End turn, and play until one lantern goes out.
CK.table("Duel").restart()deals a rematch.
Change one word for another look: style = "pixel", "cartoon", "scifi", "classic", "minimal" (every cardsKit frame style shows the painted art).
The deck
| card | type | cost | does | copies |
|---|---|---|---|---|
| Moth Swarm | Creature | 1 | Deal 3. | 3 |
| Owl Dive | Creature | 2 | Deal 6. | 2 |
| Firefly Spark | Creature | 0 | Deal 2. | 2 |
| Fox Feint | Trick | 1 | Deal 2. Draw 1. | 2 |
| Toad Guard | Ward | 1 | Gain 4 shield. | 3 |
| Hedgehog Curl | Ward | 2 | Gain 8 shield. | 2 |
| Moonwell Sip | Charm | 1 | Restore 4 glow. | 2 |
| Starlit Map | Charm | 1 | Draw 2. | 2 |
| Ember Tea | Charm | 0 | Gain 2 energy. | 2 |
| Comet Fall | Spell | 3 | Deal 10. | 1 |
| Lantern Flare | Spell | 2 | Deal 4. Gain 4 shield. | 2 |
| Willow Hush | Charm | 1 | Restore 2 glow. Draw 1. | 2 |
Glow is cardsKit's hp stat, shield its block stat. Damage hits shield first.
Guides
- Example: How to make a two-player card duel, step by step: from an empty world to a duel played to a winner, with a rematch.
- How-to: How to make a custom card deck with your own art and rules: cards as data, effects, painted art and a card back, tuning the rules, styles, winners, and putting the duel in a walking 3D room.
Rules and defaults
| setting | default | what it does |
|---|---|---|
glow (LD.GLOW) | 20 | each lantern's starting and maximum glow |
energy (LD.ENERGY) | 3 | refilled at the start of each of your turns |
hand (LD.HAND) | 5 | cards dealt when you sit down |
hand limit (LD.HAND_MAX) | 7 | you draw one card at the start of your turn while under it |
| plays per turn | any | actions = 0: play what your energy pays for, then End turn |
LD.Table(opts) takes any cardsKit table setting as an override (style, layout, seed, title, autoSeat, ...). Older played cards move to the discard pile so the felt shows the latest four plays, and an empty draw pile is refilled from the discard pile.
API
| call | does |
|---|---|
LD.Table(opts?) -> entity | spawns the duel table (build.luau) |
LD.settings(opts?) -> table | the cardsKit settings it uses, for CK.Table yourself |
LD.install(name?) | registers the rules for a table (every peer, in onLoad) |
LD.rules() -> hooks | the cardsKit rule hooks, to wrap with your own |
LD.winner(game) -> seat? | the winning seat once a lantern is dark |
LD.result(name?) -> string | the result text on any screen, "" while the duel runs |
LD.Deck | the deck module: ID, LIST, ART, size() |
Tests
zero tests run lanternDuel: the deck and its art, card conservation through a duel, shield and glow under damage and the winner, and the table settings.
Where it is used
The Game Night world puts this duel on a felt table in a cosy room, where two players sit down, play to a winner, see a results screen and take a rematch.
Versions
- 1.0.11: the duel table clears itself. Once more than four cards lie on the felt, each play sends the oldest one (by play order) to the discard pile, so the felt shows the latest plays and the duel flows on to a winner with no Clear table button. It used to pick the first card in slot order, which after the first clear was the card just played, so the table filled and every play was refused. Checked with two players over 14 turns: never more than four cards on the felt, no refusal.
- 1.0.10: the winner check installs once however often
LD.installruns (a keyedCK.on), built against cardsKit 1.0.11 (a player can no longer restart a duel in progress). - 1.0.9: built against cardsKit 1.0.10 (its card sounds carry their descriptions).
- 1.0.8: built against cardsKit 1.0.8: cards slap onto the felt with a sound, draws swish, the deck riffles when it shuffles, and every card name reads in the fanned hand.
- 1.0.7: built against cardsKit 1.0.7, whose table fits phones and tablets beside other kits (screen margins, clear of the touch buttons).
- 1.0.6: two guides: an example, "How to make a two-player card duel, step by step", and a how-to, "How to make a custom card deck with your own art and rules" (they replace the one combined guide). 1.0.5 was published without the how-to's text, so use 1.0.6.
- 1.0.5 (do not use): two guides: an example, "How to make a two-player card duel, step by step", and a how-to, "How to make a custom card deck with your own art and rules" (they replace the one combined guide).
- 1.0.4: the winner reaches every screen the moment a lantern goes dark. A win found while a card's damage resolves is now published at once; before, it waited on the dealer until the next action (found in a two-client test in Game Night, where the losing player saw no result).
- 1.0.3: card art and the card back are passed to cardsKit as texture guids (the form its frame styles draw), so every face shows its painting and the table shows the lantern back (with cardsKit 1.0.6). The deck test checks every card's art is a texture guid.
- 1.0.2: the card duel guide.
- 1.0.1: first release: the deck, rules, tests and README.
Scoped to this part · feeds back into the world's score.