GML
if (keyboard_check(vk_right)) and (keyboard_check(vk_up)) {
direction = point_direction( x,y,x+1,y-1 );
}
else if (keyboard_check(vk_right)) and (keyboard_check(vk_down)) {
direction = point_direction( x,y,x+1,y+1 );
}
else if (keyboard_check(vk_left)) and (keyboard_check(vk_up)) {
direction = point_direction( x,y,x-1,y-1 );
}
else if (keyboard_check(vk_left)) and (keyboard_check(vk_down)) {
direction = point_direction( x,y,x-1,y+1 );
}
else if (keyboard_check(vk_right)) {
direction = point_direction( x,y,x+1,y );
}
else if (keyboard_check(vk_left)) {
direction = point_direction( x,y,x-1,y );
}
else if (keyboard_check(vk_up)) {
direction = point_direction( x,y,x,y-1 );
}
else if (keyboard_check(vk_down)) {
direction = point_direction( x,y,x,y+1 );
}
image_angle = direction;