W
William Turner
Guest
As the title says i'm trying to stop the diagonal movement...All my attempts to fix the problem my self have failed miserably...
Code i'm using for movement
If anyone has any suggestions or know a tutorial I should look at please let me know.
Code i'm using for movement
Code:
//MOVEMENT
//check
if(keyboard_check(ord("W")))
{ y = y - 5;
sprite_index = spr_player_blue_up
}
if(keyboard_check(ord("A")))
{ x = x - 5;
sprite_index = spr_player_blue_left
}
if(keyboard_check(ord("S")))
{ y = y + 5;
sprite_index = spr_player_blue_down
}
if(keyboard_check(ord("D")))
{ x = x + 5;
sprite_index = spr_player_blue_right
}
//check
//Released
if(keyboard_check_released(ord("W")))
{
sprite_index = idle_up
}
if(keyboard_check_released(ord("A")))
{
sprite_index = idle_left
}
if(keyboard_check_released(ord("S")))
{
sprite_index = idle_down
}
if(keyboard_check_released(ord("D")))
{
sprite_index = idle_right
}
//Released
//MOVEMENT
Last edited by a moderator: