Talk:How do I make my player move

This is wrong !

If the player want to move diagonally, the character will move a little faster than the desired speed. Meaning an AI moving toward the player at defined speed will be disavantaged if the player move diagonally.

I'm currently searching for how to correct this, so i don't know yet the correct way to do it. Someone help ?

EDIT : OK, found 2 things :

var mx,my; mx = keyboard_check(vk_right)- keyboard_check(vk_left); my = keyboard_check(vk_down)- keyboard_check(vk_up); if mx*my != 0 { mx *= 0.707; my *= 0.707; } hspeed = mx*4; vspeed = my*4;

and that :

if (keyboard_check(vk_left)) motion_set(180,4); if (keyboard_check(vk_up)) motion_set(90,4); if (keyboard_check(vk_right)) motion_set(0,4); if (keyboard_check(vk_down)) motion_set(270,4); if (keyboard_check(vk_nokey)) motion_set(0,0);

Source :