Controller State Machine
© 2000 - Zachary Booth Simpson. Copied with permission from http://www.mine-control.com/zack. If you find any of this work useful, please sign Zack's guest book: http://www.mine-control.com/cgi/gbook-zbs.cgi. IntentTrack a complicated state process with a controller. ProblemMany Controllers are very complicated state machines which involve convoluted state transitions as circumstances progress and in response to events. Animation is the canonical example – both time and user input effect the state transitions of animations, often with many special cases and subtle complications. SolutionA Controller subclass is created which contains the list of all state variables. For example, and animation might have: currectFrame, currentAnim, lastFrameTime, etc. StructureNone at this time. ExamplesSee http://www.totempole.net/statemachines.html for a sample implementation of this technique. Issues and RisksNone at this time. Related PatternsContoller, State Discuss this article in the forums
See Also: © 1999-2011 Gamedev.net. All rights reserved. Terms of Use Privacy Policy
|