Perhaps just using SetIdle and passing it as -1 when walking starts and re-setting it again when the character stops.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menu
// now animate the character
if (Direct != DIR_STOP)
{
animFrame += 0.1;
if (animFrame >= 10.0)
{
animFrame -= 9.0;
}
// change these if you only have four directions
if (newDirect == DIR_DOWN_LEFT) player.Loop = 0;
else if (newDirect == DIR_DOWN_RIGHT) player.Loop = 0;
else if (newDirect == DIR_UP_LEFT) player.Loop = 1;
else if (newDirect == DIR_UP_RIGHT) player.Loop = 1;
else if (newDirect == DIR_LEFT) player.Loop = 1;
else if (newDirect == DIR_RIGHT) player.Loop = 2;
else if (newDirect == DIR_UP) player.Loop = 3;
else if (newDirect == DIR_DOWN) player.Loop = 0;
player.Frame = FloatToInt(animFrame);
}
else {
// TODO: set the standing frame based on oldDirect
player.Frame = 0;
}
By continuing to use this site you agree to the use of cookies. Please visit this page to see exactly how we use these.
Page created in 0.540 seconds with 15 queries.