Y
Yoo
Guest
I'm making a platformer, and I have a sprite animation for Idle and for Moving.
I've used this code for changing between the two:
if hspeed != 0
{
sprite_index = Sprite_Move
image_speed = .6;
}
else
{
sprite_index = Sprite_Idle
}
But, if I hit the wall... an object collision or the edge of the room, the object stops moving, but the Moving sprite is still on as long as I am holding the movement key. How can I make it so that if it's not moving horizontally the sprite is Idle?
Thanx.
I've used this code for changing between the two:
if hspeed != 0
{
sprite_index = Sprite_Move
image_speed = .6;
}
else
{
sprite_index = Sprite_Idle
}
But, if I hit the wall... an object collision or the edge of the room, the object stops moving, but the Moving sprite is still on as long as I am holding the movement key. How can I make it so that if it's not moving horizontally the sprite is Idle?
Thanx.