J
Joltout
Guest
So basically, I'm trying to get my character to slide in their skidding animation/image_index to a stop when either no directional keys are pressed (or both at the same time), or when the player changes direction and their momentum is still carried over (for example, sliding them right when they're trying to move left).
And while I have the characters movement down fine, getting the animations for the sprite to work right is proving to be a pain in my rear. I've tried multiple ways of coding around it, but me being the newbie I am, I haven't found a solution. As far as I can understand, the code I've written prioritises the right side movement because it comes first in the code, so the animation works fine on the right, but when I move left, the character is just permanently in the sliding animation.
Any help?
And while I have the characters movement down fine, getting the animations for the sprite to work right is proving to be a pain in my rear. I've tried multiple ways of coding around it, but me being the newbie I am, I haven't found a solution. As far as I can understand, the code I've written prioritises the right side movement because it comes first in the code, so the animation works fine on the right, but when I move left, the character is just permanently in the sliding animation.
Any help?
Code:
if (place_meeting(x,y+1,oWall))
{
if ((!hsp == 0) and (!key_right or !key_left))
{
sprite_index = N_Skid;
image_index = 1;
}
}