L
Lemon85
Guest
I'm trying to make a walking system where right, up, and down show the character facing right and left shows him facing left. When you move diagonally up or down to the right it works, but when you move either diagonally left/up or left/down, when you let go of the buttons, it automatically goes back to the right facing sprite.
This is what I have in the STEP for the player object:
and this is what I have in the Key-Down for the directions (but the sprite is different for the left):
then in the Key-Up I have (except the sprite is different again for the left):
This is what I have in the STEP for the player object:
Code:
if(keyboard_check(vk_left)&&keyboard_check(vk_down))
{
sprite_index = walkleft
}
if(keyboard_check(vk_left)&&keyboard_check(vk_up))
{
sprite_index = walkleft
}
Code:
sprite_index = walkright
x += -5;
Code:
sprite_index= rightdonothing;