logo
By Lawrence

5 minutes

Chips, the Pot, and Whose Turn It Is

A poker table needs two things before any card is dealt: chips, and a way to track whose turn it is. PokerBetting owns both — the stacks, and the state machine that moves around the table and stops on you. The rest of the game is built on top of it.

Stacks of gold and clay poker chips around an emerald felt table with a growing central pot, one seat lit by a bright moving spotlight cursor to show whose turn it is while the others sit in shadow, faint glowing bet amounts hovering over each stack, warm gold and crimson accents on near-black, high-stakes and cinematic.

How to pick the build order

This game is made of fourteen components. We don't pick the build order by feel. Each component lists two things in its meta.json file. It lists the components it depends on. It also lists the events it emits and listens for. We sort by those two things:

  • A component comes after everything in its dependencies. It also comes after every component whose events it listens for.
  • So a component with no dependencies that emits events others wait on comes early.
  • The director depends on all of them and connects every event. So it comes last.

When you run that sort, PokerBetting comes first among the game pieces. It has zero dependencies. It never imports the deck, the cards, or an opponent. But it emits the turn, action, and chip events. The HUD, the keyboard, the pacer, and all three AIs listen for those events. So PokerBetting gets built first and everything that listens to it follows. You can run this same sort on any library game to find its build order.

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