in this game i’m working on, i’m about to spend some time on the animation process, and i’m not sure if the method i’m currently using is that good. i’ll try to explain it, though it might be hard to follow… right now, my characters are made up of different movie clips (one for each body part) which are moved around for each animation (kind of like a 2D skeleton). for each animation/action my characters can do, i’ve placed the body part movieclips in an animation movieclip(one for standing, one for running, etc), and repositioned those body parts on each frame of the animation movieclip. each of these animation movieclips has it’s own frame within the “character” movieclip. so basically i have my character movie clip, and on each frame of that is an animation movieclip, and on each frame of that there are my body part movie clips which are positioned for the animation (and there are different frames for each body part, depending on what the character is supposed to look like).
■■■■, this is hard to explain, let me try to give an example. lets say i have a character with the instance name “ninja”, and he starts running. This line of code: ninja.gotoAndStop(4) will execute, taking the character movie clip to frame four, which contains the “running” movieclip. the “running” movie clip consists of eight frames, which are cycled at a rate dependant on the running speed of the ninja. each of these frames has the body part movie clips which have been positioned to look like a running character (so on one frame the right leg is bent in front of the extended left leg, in another the left is bent in front of the right, etc). within each of these body part movie clips are different frames with different looks for that body part, via a line of code which says: this.gotoAndStop(_root.character_body[_parent._parent.number]). each character has a “number” variable, and i use an array called character_body to control what each character looks like. the character_body of my ninja is #4, and i’ve set the fourth frame of each body part to look like the body part of a ninja (the head has a mask and hood, the torso is covered in black cloth, etc).
so to get to the point, i want to know if this is an efficient way to animate my characters. i don’t really know how flash works when it comes to rendering objects, and i don’t know if my current method is efficient. I’m worried that maybe with all these movie clips constantly loading and reloading, things can get really slowed down if i have a lot of characters on the screen doing stuff. i was thinking of maybe writing a script that manually changes the x/y coordinates and rotation of each body part with each animation, so everything is only loaded once and then repeatedly repositioned from that point on. would this be more efficient, or does it not make any difference. if you’ve bothered to read this whole post, thank you, sorry it was so ■■■■ long! and if you don’t understand what the hell it is that i’ve described, please ask for more details. thanks!