C
clyver
Guest
I've trying to do this for a while. I want to the jumping sprite change when the player is jumping and falling. I tried a lot of things but mostly of them didn't work out well. Here's the code I've put on the Player's Input Event
I want the player to have a sprite animation playing while jumping and attacking, that one being SPiresAtP, and a sprite animation while falling and attacking, that one being SPiresAtA. "X" is the key for attack.
Code:
if (!place_meeting(x,y+1,OBloco2)) && (keyboard_check(ord("X")))
{
if(sign(vsp) > 0)
{
sprite_index = SPiresAtP;
}
else
{
sprite_index = SPiresAtA;
}
}
else
{
if (hsp == 0)
{
if (keyboard_check(ord("X")))
{
sprite_index = SPiresAt;
image_speed = 0.75;
}
else
{
sprite_index = SPires;
}
}
}