Hi everyone, i have made a top down control system that uses lengthdir_x and lengthdir_y to move. The system is good because you move the same speed in every direction but i am not sure how to handle collisions, please help?.
var hspd = (keyboard_check(vk_right) - keyboard_check(vk_left)) * move_speed;
if (!place_meeting(x + hspd, y, o_solid))
x += hspd;
while (!place_meeting(x + sign(hspd), y, o_solid))
x += sign(hspd);
hspd = 0; // Set to 0 in case code below is based on what "hspd" is