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.

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 itlistensfor. - 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.