im making a game where the player moves towards the mouse when you hold the left mouse button and i dont know how i would go about doing the collisions with the code that i have.
How would i do the collisions with a wall?
player movement code:
create event:
friction = 1.5;
spd = 0;
max_spd = 24;
acceleration = 3;
angle = 0;
step event:
if (mouse_check_button(mb_left)) {
spd += acceleration;
move_towards_point(mouse_x,mouse_y,spd);
if (spd > max_spd)
spd = max_spd;
}
else {
spd = 0;
}
How would i do the collisions with a wall?
player movement code:
create event:
friction = 1.5;
spd = 0;
max_spd = 24;
acceleration = 3;
angle = 0;
step event:
if (mouse_check_button(mb_left)) {
spd += acceleration;
move_towards_point(mouse_x,mouse_y,spd);
if (spd > max_spd)
spd = max_spd;
}
else {
spd = 0;
}