if (movable)
{
//Jump
- if (Events::getJump() && abs(yFloorDist)<.5)
+ if (Events::getJump() && abs(yFloorDist) < .5)
+ {
ySpeed = 5.5;
+ //startanimation(1, 1);
+ //setAnimationLoop(false);
+ }
int move_x = Events::getMoveX();
int move_y = Events::getMoveY();
}
//MOVE Animation
- if (move_y > 0)
+ if (abs(yFloorDist) < .5)
{
- if (animationSpeed <= 0)
+ if (move_y > 0)
{
- startanimation(0, 1);
+ if (animationSpeed <= 0)
+ {
+ startanimation(0, 1);
+ setAnimationLoop(true);
+ }
}
- }
- else if (move_y < 0)
- {
- if (animationSpeed >= 0)
+ else if (move_y < 0)
{
- startanimation(0, -1);
+ if (animationSpeed >= 0)
+ {
+ startanimation(0, -1);
+ setAnimationLoop(true);
+ }
+ }
+ else
+ {
+ startanimation(0, 0);
+ setAnimationLoop(true);
}
}
- else
- {
- startanimation(0, 0);
- }
+
//Rotate Player in move direction
if (move_x || move_y)