Appearance Map
© 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.totempole.net/cgi-bin/gbook.cgi. IntentIsolate Model state from Model appearance to minimize impact on controllers when art changes. ProblemControllers are often complicated little state machines which interact with Models in very specific ways. It is common for this interaction to change the appearance of the Model, especially in animation controllers. Since art may change frequently (example: more frames are added to an animation) it makes sense to separate the state from the appearance. SolutionWithout an appearance map, a controller is likely to change the "frame" of an animation directly. For example:if (state == WALKING) { model.frame = WALK_START_FRAME + WALK_NUM_FRAMES * (WALK_DURATION / dt) ; } StructureNot available at this time. Issues and RisksNone at this time. Related PatternsAppearance Maps translate Model state into an appearance for the View. Uses and ReferencesSpecial thanks to Jim Greer. Discuss this article in the forums
See Also: © 1999-2011 Gamedev.net. All rights reserved. Terms of Use Privacy Policy
|