A
Arthur_echoes
Guest
Im making a game project (still learning) and im trying to make an obj "sword" change depth when the mouse is in north of the screen.
i did it as a similar thing when i made the obj "player" change xscale on mouse position
//xscale on cursor//
var mouse_dir;
mouse_dir = point_direction(o_player.x, o_player.y, mouse_x, mouse_y);
if mouse_dir > 90 and mouse_dir < 270 {
o_player.image_xscale = -1;
} else {
o_player.image_xscale = 1;
}
with the obj "sword" i tried a similar thing but it didn't worked
// depth on mouse position
var mouse_dir;
mouse_dir = point_direction(o_player.x, o_player.y, mouse_x, mouse_y);
if mouse_dir < 0 and mouse_dir > 0 and mouse_dir <90 and mouse_dir >270{
object_set_depth (o_sword,1)
} else {
object_set_depth (o_sword,0)
}
i did it as a similar thing when i made the obj "player" change xscale on mouse position
//xscale on cursor//
var mouse_dir;
mouse_dir = point_direction(o_player.x, o_player.y, mouse_x, mouse_y);
if mouse_dir > 90 and mouse_dir < 270 {
o_player.image_xscale = -1;
} else {
o_player.image_xscale = 1;
}
with the obj "sword" i tried a similar thing but it didn't worked
// depth on mouse position
var mouse_dir;
mouse_dir = point_direction(o_player.x, o_player.y, mouse_x, mouse_y);
if mouse_dir < 0 and mouse_dir > 0 and mouse_dir <90 and mouse_dir >270{
object_set_depth (o_sword,1)
} else {
object_set_depth (o_sword,0)
}