P
piksil_demon
Guest
you know in those games that have 8 directional movement, but only 4 movement animations? can you help me figure that out with this movement code here-
// variables
up = keyboard_check(ord('W'));
down = keyboard_check(ord('S'));
left = keyboard_check(ord('A'));
right = keyboard_check(ord('D'));
// movment
x+= (right - left)*spd;
y+= (down - up)*spd;
if speed > spd {
speed = spd;}
ideally it would be that the character faces the first direction pressed in the diagonal, but as long as it dosnt spazz out it will work
// variables
up = keyboard_check(ord('W'));
down = keyboard_check(ord('S'));
left = keyboard_check(ord('A'));
right = keyboard_check(ord('D'));
// movment
x+= (right - left)*spd;
y+= (down - up)*spd;
if speed > spd {
speed = spd;}
ideally it would be that the character faces the first direction pressed in the diagonal, but as long as it dosnt spazz out it will work