So I'm trying to create a gravity based shooter that uses the keyboard to move, and the mouse to aim and shoot. I've set up the sprites so that the gun and arm of the player follow the mouse.
I then set the player animations to be based off of the relative position of the player to the mouse. Ex: If you're running left, but shooting right, the right animation will continue to play while you move left, since the mouse has a greater x/y then the player. So here's the code that I used to make this happen.
However, the issue I'm running into is that there's one spot where the function gets thrown off. Everything works perfectly around the planet until the player hits this section, and then the animations suddenly get flipped. I'm assuming this is because the x/y of the mouse in this specific spot, but I have no idea how to fix it. I'm extremely new to coding thing, so I would immensely appreciate any help or advice you guys can offer!
I can also send the file if you need it (as I can't figure out how to post the link to the dropbox file.