Topic: Game Programming /
Game Objects with multiple animations
This question feels a bit newB, but I have to ask it anyway.
Say I have a game object with multiple animations:
—idle
—get hit
—die
—attack
—etc.
What is the best way to deal with this in AS3? Several solutions come to mind, but I feel like I might be missing the easiest/obvious one:
Option A) Have all animations loaded into one movie clip and control what plays just by controlling the movie clip playhead
Option B) Have separate movie clips for each animation. Whenever the game object status changes, destroy any current movie clip that is playing an instantiate the proper one. (e.g delete IDLE mc and spawn a new GETHIT mc)
Option C) Have separate movie clips for each animation. Create one parent mc for the game object, and create movie clip instances of each anim that will be children to this parent. Control visibility of all child clips base upon status of the game object. (e.g. make everything invisibile but IDLE)
Down sides of all these:
A) lots of frame jockeying/maintenance
B) maybe the best?
C) will have lots of invisible movie clips hanging around
Am I missing an obvious solution?
—NeoClassic
|