Confused and unable to use animations and directions
by Ronny Germany · in Game Design and Creative Issues · 08/03/2010 (11:19 am) · 1 replies
I am trying to make an Isometric 8 direction character move around the screen.
Up, Down, Left, Right, DownRight, DownLeft, UpRight, UpLeft.
I have the character ACTUALLY moving, but not animating. The movement was the easy part.
I tried going through the Platformer tutorial, but it's proving to be of no help.
I tried
if(%this.moveUp && !%this.moveRight && !%this.moveLeft)
{
%this.playAnimation(KnightWalkUp);
}
The animation KnightWalkUp is a 2 frame animation. This works, but whenever I am moving Up, it only shows the FIRST frame only. It doesn't animate until AFTER I stop moving upwards. This is the exact opposite as I want.
I tried adding in "else {%this.playAnimation(KnightIdleUp);}
This is a single frame animation. The result? If I move upwards, it does a NON-ANIMATED KnightWalkUp, and when I stop it changes to the correct Idle animation. So the only problems now are...
1) It won't animate WHILE MOVING. It only animates while NOT moving, which is pointless.
2) How can I do a simple 8 directional animation (and 8 idles for each direction) without having 1000 nested if-else statements???
I need it to ANIMATE 1 of 8 walking animations depending on Up Left Down Right and a combo (diagnals) but for it to IDLE 1 of 8 walking animations dependong in the last direction.
Up, Down, Left, Right, DownRight, DownLeft, UpRight, UpLeft.
I have the character ACTUALLY moving, but not animating. The movement was the easy part.
I tried going through the Platformer tutorial, but it's proving to be of no help.
I tried
if(%this.moveUp && !%this.moveRight && !%this.moveLeft)
{
%this.playAnimation(KnightWalkUp);
}
The animation KnightWalkUp is a 2 frame animation. This works, but whenever I am moving Up, it only shows the FIRST frame only. It doesn't animate until AFTER I stop moving upwards. This is the exact opposite as I want.
I tried adding in "else {%this.playAnimation(KnightIdleUp);}
This is a single frame animation. The result? If I move upwards, it does a NON-ANIMATED KnightWalkUp, and when I stop it changes to the correct Idle animation. So the only problems now are...
1) It won't animate WHILE MOVING. It only animates while NOT moving, which is pointless.
2) How can I do a simple 8 directional animation (and 8 idles for each direction) without having 1000 nested if-else statements???
I need it to ANIMATE 1 of 8 walking animations depending on Up Left Down Right and a combo (diagnals) but for it to IDLE 1 of 8 walking animations dependong in the last direction.
Ronny Germany