Xer0botXer0
Senpai
Hi fellow game devs,
So to the point my game's point click movement, so far the player clicks somewhere with the mouse and the player moves there, the thing is if I've got say an ocean i dont want the player to be able to click on the ocean, so i'm using an if statement, if the mouse_x/y coordinates are not within the sprite mask of an object(barrier) then do the player can move, else ignore it.
so what I'm thinking is
1) can I use with (mouse_x) ?
2) if not is there an alternate means ?
3) if distance_to_point > 1, is that 1 pixel outside of the sprites mask ?
4) If I use obj_barrier.x/y in distance_to_object/point, does this look at the nearest obj_barrier or just a random one in the room ?
sorry for the questions, I just haven't learnt the answers to these yet.
So to the point my game's point click movement, so far the player clicks somewhere with the mouse and the player moves there, the thing is if I've got say an ocean i dont want the player to be able to click on the ocean, so i'm using an if statement, if the mouse_x/y coordinates are not within the sprite mask of an object(barrier) then do the player can move, else ignore it.
so what I'm thinking is
Code:
with (mouse_x)
{
if distance_to_point(obj_barrier.x, obj_barrier.y) > 1
{
can_move = true
}
}
2) if not is there an alternate means ?
3) if distance_to_point > 1, is that 1 pixel outside of the sprites mask ?
4) If I use obj_barrier.x/y in distance_to_object/point, does this look at the nearest obj_barrier or just a random one in the room ?
sorry for the questions, I just haven't learnt the answers to these yet.