Sry i have so many questions ,i just finished my exam session and my brain is still woking on power saving mode XD. The problem i encounter is as follows: I have more animations on 1 spritemap. each animation its a direction of movement.(“u”-up ,“d” -down,“l”-left “r”-right and so on ) I want for this animation to be fluent when switching directions.
Also “n” its a static animation set with speed 0 that has every frame of the animations
public function movementAndLegAnimSet():void
{
saveLegAnim = legAnim;
saveFrame = legsMap.frame;
legAnim ="";//reset leganim
if (Input.check(Key.W)) {
y -= 0.5;
legAnim = legAnim + "u";
}
else{
if (Input.check(Key.S)) {
y += 0.5;
legAnim = legAnim + "d";
}
}
if (Input.check(Key.A)) {
x -= 0.5;
legAnim = legAnim + "l";
}
else{
if (Input.check(Key.D)) {
x += 0.5;
legAnim = legAnim + "r";
}
}
if (legAnim == "") {
legAnim = "n";
legsMap.play(legAnim);
legsMap.frame = saveFrame;
}
else {
legsMap.play(legAnim);
if (legAnim != saveLegAnim) {
legsMap.frame = saveFrame;
}
}
}
Is u move and then stop moving its ok,it remains on the specific frame.But for some reason,if u begin to move again the animations(i mean the animation for each direction) start from the 1st frame of their frame array.
Any ideas? And again sry for so many questions >.<