# gameNight.fortune
Makes a boardKit board's "draw a card" spaces deal a real card from a cardsKit table. It registers the Lantern Fortune deck: six original painted cards, 14 in all, that hop you forward, give another turn, find coins, or set back or put to sleep the leader. `Fortune.table(name, seats)` gives the settings for the hidden card table that holds them. `Fortune.install({ board, cards })`, called on every machine, makes the host deal a card into the landing player's private hand and check every play: only on that player's own turn, before rolling, never while a pawn moves or a fork waits. `Fortune.syncSeat(board, cards)`, called each frame on each screen, seats the player at the card table in the seat they hold on the board. The board must be placed with `cards = "event"`. Game Night's race table uses it, and RaceStation draws each player's held cards as a strip they tap to play.
# gameNight.progress
Each player's Game Night record in their own saveKit profile: XP for cards played (3), dice rolled (2), finishing a duel or race (40) and winning (100 more); stats `duelsPlayed`, `duelsWon`, `racesPlayed`, `racesWon`, `cardsPlayed`, `diceRolled`; a rank title per level (Newcomer, Regular, Card Sharp, Dice Whisperer, Table Captain, Lantern Keeper, Game Night Legend). Calls act on the local player only.
# gameNight
The game glue of the **Game Night** world: a cosy room where friends sit down at tables and play a card duel and a dice race, plus a gallery of every style the kits offer. Everything the games are made of comes from installable kits; this package only joins them up, so it is also a worked example of combining them.
| part | what it does |
|---|---|
| `DuelStation` component | Joins the felt table (tableKit) to the Lantern Duel (cardsKit + lanternDuel): sitting in a chair takes that card seat and opens the card screen for you alone (`setLocalUi`), the table machine moves the turn indicator and writes glow, shield and card count on the nameplates, and a finished duel shows the results screen with Rematch. |
| `RaceStation` component | Joins the tavern table (tableKit) to the race board (boardKit) and the dice tray (diceKit): your chair is your pawn, only the seat whose turn it is may roll (R, pad A, tap or drag on the tray, or the Roll button), the dice total moves the pawn, board events show as a line at the top, the turn ring follows the board, first pawn home wins, and the results screen offers a rematch. |
| `Gallery` component | The gallery kiosk: one panel (Dice, Boards, Pawns, Tables, Cards) listing every entry of the four kits' catalogs, applying a pick live to the try-out table or either game table. Mouse, touch, keyboard and gamepad. |
| `results` module | The shared end screen: MatchFlow's winner banner with Rematch and Stand up. |
| guide | [How to make a board game with dice and turns, at a table with seats](gameNight.package/guides/how-to-make-a-board-game-with-dice-and-turns-at-a-table-with-seats) |
## Quick start
The Game Night world's `scenes/main.scene/build.luau` places everything; the parts that matter:
```lua
local TK = require("tableKit.api")
local LD = require("lanternDuel.rules")
local BK = require("boardKit.api")
local DK = require("diceKit.api")
-- the duel
TK.Table { name = "Duel", position = { -3.6, 0, 0 }, yaw = 90, style = "felt", shape = "round", seats = 2, hud = "top" }
LD.Table { name = "DuelCards", style = "fantasy", autoSeat = false }
entity.spawn("DuelStation").component.add("gameNight.DuelStation", { tableName = "Duel", cardsName = "DuelCards" })
-- the race
TK.Table { name = "Race", position = { 3.6, 0, 0 }, yaw = -90, style = "tavern", shape = "long", seats = 4, hud = "top" }
BK.Board { name = "RaceBoard", position = { 3.6, 0.76, -0.42 }, size = 0.82, track = "loop", spaces = 30, autoSeat = false }
DK.Tray { name = "RaceDice", position = { 3.6, 0.76, 0.6 }, dice = { "d6" }, look = "wooden", showUi = false, input = false }
entity.spawn("RaceStation").component.add("gameNight.RaceStation", { tableName = "Race", boardName = "RaceBoard", trayName = "RaceDice" })
-- the gallery kiosk
entity.spawn("GalleryKiosk").component.add("gameNight.Gallery", {})
```
Defaults: the duel is two players, 20 glow, 3 energy, 5 cards; the race is up to four players on a 30-space loop with a d6, overshoot finish and fortune cards. Change any look or rule with one setting on the kit it belongs to (see each kit's README, or open the gallery kiosk in play).
## How to play
- Walk up to a chair and press **E** (pad **A**, or tap the prompt) to sit; **Esc** (pad **B**, or Stand up) to stand. **C** (pad **Y**) changes the camera view.
- **Card duel**: drag a card from your hand onto the felt (or tap it, then tap the felt), play what your energy pays for, press End turn. Damage hits shield first; the first lantern to reach 0 glow loses.
- **Dice race**: on your turn press **R**, tap or click the tray, press pad **A**, or drag across the tray to aim a throw. Your pawn hops the total; spaces push you on, send you back, skip your next turn, warp you or draw a fortune card. First home wins.
- **Gallery**: walk to the lectern in the north alcove and press **E**. Pick a tab, a target table, and an entry; it changes on every screen at once.
## Tests
The kits carry the tests (cardsKit, lanternDuel, tableKit, boardKit, diceKit test suites). This package is checked by playing: two clients seated at each table, a full duel and a full race to a winner, rematch, and the gallery applying entries to each target.