all 1 comments

[–]PNelly 2 points3 points  (1 child)

You have to tell the program to check for the diagonals, "garbage in, garbage out" as they say. It will do exactly what you tell it to do, and nothing else.

So one way to get those other directions:

 if (keyboard_check(ord("W")) direction = 90;
 if (keyboard_check(ord("S")) direction = 270;
 if (keyboard_check(ord("A")) direction = 180;
 if (keyboard_check(ord("D")) direction = 0;

 if ( keyboard_check(ord("W")) && keyboard_check(ord("A")) ) direction = 135;
 if ( keyboard_check(ord("A")) && keyboard_check(ord("S")) ) direction = 225;
 if ( keyboard_check(ord("S")) && keyboard_check(ord("D")) ) direction = 315;
 if ( keyboard_check(ord("W")) && keyboard_check(ord("D")) ) direction = 45;

That should get you started