So I have a character in isometric view 2.5D.
I’m wanting to be able to track the location of the mouse relative to the player/character. So if the mouse is within 90 degrees to the left of the character I’ll toggle the left sprite, 90 degrees above toggle the up sprite and so on.
So I basically need to be able to check if the mouse is within 90 degrees to the sides of the character and based on the toggle up, down, left and right sprites to make him face that direction.
alt text
Hopefully the image gives a better idea of what I’m trying to achieve.
At the moment I’m getting the location and checking if its less that x,y but of course this is where I ran into the problem because now only y positive and negative work and because its either higher or lower on the y axis left and right don’t work…
Hopefully the image gives a better idea of what I’m trying to achieve.
At the moment I’m getting the location and checking if its less that x,y but of course this is where I ran into the problem because now only y positive and negative work and because its either higher or lower on the y axis left and right don’t work…