A
AutoLiMax
Guest
Hi, I'm trying to flip the character left or right depending on the mouse position in relation to the character.
So if the mouse is on the right side of the character it would face right and if mouse is on the left side of the character it would face left.
Currently I have it set up to flip the character based on the mouse position on screen like so:
This works fine until the character gets to the edge of the level which messes it all up.
I need to say something like
How would one go about doing this?
Thanks!
So if the mouse is on the right side of the character it would face right and if mouse is on the left side of the character it would face left.
Currently I have it set up to flip the character based on the mouse position on screen like so:
Code:
//Set character facing direction
var mouseX = window_mouse_get_x();
if (mouseX > 640)
{
image_xscale = (1);
}
else
{
image_xscale = (-1);
}
I need to say something like
Code:
if (mouseX position in relation to the character > 0)
{
image_xscale = (1);
}
else
{
image_xscale = (-1);
}
Thanks!