Dr_Nomz
Member
I can't believe this isn't working, but here's my code:
Now I've tried putting this in a mouse_enter event, and trying a few variations with "abs(mouse_coords)" but nothing is working.
All I want is for the image_index to be 0 (set in create event, kept still with image_speed=0 in step) and then switch between the two depending on if the mouse cursor is over the door, and the E key is pressed.
I'd also REALLY like to have it so the mouse can be a few pixels away from the door and still work, like instead of y10 or x10 (away from mouse) it could be 50, or something.
EDIT: Also my NPCS are stupidly acting like there's something in the way of their path even if the door is open and can be walked through... any suggestions for fixing that? (Like maybe changing the sprite mask of the door, or using a different approach in opening it?)
Code:
if image_index=0{
if keyboard_check(ord("E")){
image_index=1
}
}
if image_index=1{
if keyboard_check(ord("E")){
image_index=0
}
}
All I want is for the image_index to be 0 (set in create event, kept still with image_speed=0 in step) and then switch between the two depending on if the mouse cursor is over the door, and the E key is pressed.
I'd also REALLY like to have it so the mouse can be a few pixels away from the door and still work, like instead of y10 or x10 (away from mouse) it could be 50, or something.
EDIT: Also my NPCS are stupidly acting like there's something in the way of their path even if the door is open and can be walked through... any suggestions for fixing that? (Like maybe changing the sprite mask of the door, or using a different approach in opening it?)