Thursday, 14 January 2010
Walking + Variable Control
Arrow Keys and W,S,A,D to move the characters.
Another movement update, thanks to Trev, my character now continuously plays his walking animation when going in both directions. What seems to happen is that from the first frame, a movieclip and nextFrame(); tag is used:
mcMain.nextFrame();
Here the first frame of the movie clip is being referenced, which is the standing still animation that is sitting in a movieclip of its own. What then happens is that after the first frame is the walking animation tween, which means when the keypress is made, mcMain will more or less play the frames after frame 1. When the key is released, the animation will use a gotoAndStop(1); tag to send him back to the standing animation.
Now I already had variables set to dictate the speed of movement of my character, however once I slowed down the speed variable, the walking speed matched the animation speed, so that was something I was very happy with once having worked on it with Trev.
What has to be figured out now is the possibity of adding more animations, as a nextFrame(); element can't be used whether my next animation comes after the walking animation in the timeline, or if it's in a separate movieclip on that timeline..
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment