5 minutes
The betting engine runs as pure data. It holds the stacks, the pot, and a pointer to whose turn it is. But right now there is nothing to bet on. The table needs a deck, so that is what we build next. Cards are the first thing the chip machine has been waiting for. A harder question hides under that one. Soon this becomes a four-seat game, and every player runs the same code on their own machine. So how do all four agree on the exact same shuffle? Get that wrong, and one player sees the ace of spades while another sees a seven.
This lesson adds the deck. It builds no meshes and draws nothing on screen. Instead, it makes card ids as strings and announces each one over the bus. That sounds small. But the way it shuffles is the key to the whole multiplayer story.

Add the Dealer to the scene
Open src/scenes/poker.json and add one entity next to Felt:
The component source already lives at src/components/DeckDealer/. Lesson 1's bjs download scene PokerTableDirector --all pulled it in. These settings spell out Texas Hold'em. playerCount: 4 and cardsPerPlayer: 2 mean four seats with two hole cards each. riverSize: 5 is the community row. localIndex: 0 marks which seat is yours. And roomCode: "table-7" is the interesting one — it is half of a seed.
Continue reading
Unlock the Full Course
Every lesson, the runnable examples, and the finished build — yours to keep.