logo
By Lawrence

5 minutes

Add the Director and Finish the Game

Every part works, but nothing happens. Load the scene and you see a lit table with a deck, chips and a turn order, three opponents who each play their own way, a HUD, and a keyboard. No deal fires. The flop never turns. Nobody asks for the showdown. Every component but one is wired to the bus, and they are all waiting for someone to say go.

PokerTableDirector is that missing piece. It imports its siblings only to read their Event constants (and PokerBetting's setStrategies seam). Every message between components travels on the bus. The director decides when things happen, not how they happen.

Add the Match entity to the scene

Add one entity, and the scene is complete:

"Match": {
  "components": {
    "PokerTableDirector": {
      "variant": "texasHoldem",
      "startingStack": 500,
      "delayBetweenHands": 4,
      "strategyNames": ["Randy", "Bill", "Cali"]
    }
  }
}

Now src/scenes/poker.json matches the real example.scene.json exactly. That is 13 entities and 18 component placements.

Continue reading

Unlock the Full Course

Every lesson, the runnable examples, and the finished build — yours to keep.

$9one-time

Was this page helpful?

We read every note — tell us what's working and what isn't.

↑↓ NavigateEnter SelectEsc CloseCtrl+K Open Search