The problem with
x+= (keyboard_check(right) - keyboard_check(left))*4
y+= (keyboard_check(down) - keyboard_check(up))*4
...simplified the math here...
I use that all the time...
is the diagonal movement is faster than straight movement; you move 1.4 units (*4 in the example ) diagonally as oppose to 1 unit (*4 in the example). Which is fine when you want to move exactly from x,y 1,1 to 5,5 for example. Dead on the grid.
But for "truer" even movement, you need to add another step
dx = (keyboard_check(right) - keyboard_check(left));
dy = (keyboard_check(down) - keyboard_check(up));
//translate to direction
dir = point_direction(0,0,dx,dy);
//move evenly diagonally or straight, speed 4
speed = 4
direction = dir
Edited by icuurd12b42, 24 September 2009 - 07:54 AM.