Game State Machine

Let's face it, you can't get far without keeping track of where you are, and where you are going next. Building on our friend the Update Package, it is straightforward to build a state machine implementation, where each state has an Update Package associated with it. When a state is current, it's Update Package executes, until it decides that state is complete. At that point, the State Machine's client is notified, whereby that code can respond to the state change before acknowledging it (e.g. display some text, instant replay, etc.), at which point the GSM starts executing its new state. This "coroutine" protocol cleanly separates detecting state change conditions, and the responses of a Master Layer to those.

Last edited Jul 7, 2008 at 5:12 PM by escapellc, version 1


No comments yet.