B
bleuthoot
Guest
Hello,
Before you read:
I wanted it to look like this
You can currently move the player and nothing else.
I have already tried some things:
if (keyboard_pressed(vk_down)) x = obj_plr1.x + 32;
if (keyboard_pressed(vk_left)) y = obj_plr1.y - 32;
if (keyboard_pressed(vk_right)) y = obj_plr1.y + 32;
How do I do this?
Before you read:
- the player = obj_plr1, you can control this player with your keyboard
- the partner = obj_plr2, this player is supposed to follow obj_plr1
I wanted it to look like this
You can currently move the player and nothing else.
I have already tried some things:
- Let the partner go to the player using move_towards_object(obj_plr1), this worked but not really in the way I wanted
- Use the exact position with a 32 pixel difference (This didn't work at all). In the step event of obj_plr2:
if (keyboard_pressed(vk_down)) x = obj_plr1.x + 32;
if (keyboard_pressed(vk_left)) y = obj_plr1.y - 32;
if (keyboard_pressed(vk_right)) y = obj_plr1.y + 32;
How do I do this?