Managing Animation State in GameObjects
ulfben Jan 26th, 2016 (edited) 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- This is an example of the simplest solution I can think off.
- My question is: are there any good standard solutions / practices / patterns
- to deal with animation states? Especially as they get more complex than two states
- I imagine this solution being way too unwieldy to maintain.
- _idleAnimation and _turnAnimation are both members of the GameObject,
- and children of its DisplayList.
- private function updateAnimationState(dx:Number):void
- if(Math.abs(dx) < 4)
- _turnAnimation.scaleX = (dx < 0) ? 1 : -1; //flip left/right
- //EDIT: http://gamedev.stackexchange.com/questions/27079/data-driven-animation-states seems like a well researched comment
RAW Paste Data