O
Ourobolus
Guest
Hi everyone!
Still relatively new to GameMaker, I've watched a bunch of tutorials and the like, but I'm having issues making it so that the player character performs their movement first, and then uses the item that is clicked on. For example, I click on a light switch, the player moves to it, and THEN the light clicks on. Right now all I can seem to do is have the light turn on when it is clicked, while the player moves towards it simultaneously.
Currently I have a horizontal movement script set up on left-click event for the player object which pretty much consists of one line:
and a step event for the player object that stops when they reach that point:
On the light switch I have in a step event (which...i'm sure isn't the best place for it - i've also tried it in a left-mouse-click event):
the scr_light_switch() script just changes the lighting, that seems to work fine.
Any thoughts? I've looked through the documentation, including the Events entry, and I can't seem to figure out how to do this. Thanks in advance!
Still relatively new to GameMaker, I've watched a bunch of tutorials and the like, but I'm having issues making it so that the player character performs their movement first, and then uses the item that is clicked on. For example, I click on a light switch, the player moves to it, and THEN the light clicks on. Right now all I can seem to do is have the light turn on when it is clicked, while the player moves towards it simultaneously.
Currently I have a horizontal movement script set up on left-click event for the player object which pretty much consists of one line:
Code:
move_towards_point(target_x, y, 8);
Code:
if point_distance(x, y, target_x, y)<8 {
speed = 0;
}
Code:
if mouse_check_button_pressed(mb_left) {
if collision_point(mouse_x, mouse_y, o_light, true, false) {
scr_light_switch();
}}
Any thoughts? I've looked through the documentation, including the Events entry, and I can't seem to figure out how to do this. Thanks in advance!