I cant make my player do an animation without moving

Ozcelot

Member
The thing is that my game doesn't need my character to move, but i can't make it do the dodge animation or any other without it to be moving

movespeed is 4, and i use dodgeSide to decide wich side is the player dodging (true for left, false for right)
and inside of estados_jugador.DODGE is a function that (should) play the corresponding animation

here the animation is reproduced


switch (keyboard_key)
{

case vk_left:
x -= movespeed;
dodgeSide = true;
estado = estados_jugador.DODGE;
break;

case vk_right:
x += movespeed;
dodgeSide = false;
estado = estados_jugador.DODGE;
break;

}


here it doesn't


switch (keyboard_key)
{

case vk_left:
dodgeSide = true;
estado = estados_jugador.DODGE;
break;

case vk_right:
dodgeSide = false;
estado = estados_jugador.DODGE;
break;

}



...i dont really know what to do now :T
 

curato

Member
you likely have someone somewhere else in your code that is setting image_speed to zero if the movespeed is zero. I tend to set the animation speed where I set the action to avoid not seeing you aren't setting it.
 

Ozcelot

Member
you likely have someone somewhere else in your code that is setting image_speed to zero if the movespeed is zero. I tend to set the animation speed where I set the action to avoid not seeing you aren't setting it.
i was bussy yesterday, lemme try it and ill let u know, thanks!
 

Ozcelot

Member
you likely have someone somewhere else in your code that is setting image_speed to zero if the movespeed is zero. I tend to set the animation speed where I set the action to avoid not seeing you aren't setting it.
I solved it! It turns out that it had an "if" that said that if the character did not move, the status of "idle" would be given, that is, that the sprite will not move (image_speed = 0), thanks!
 
Top