How can I get the angle from a rotated sprite?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By BonelessFrog

I have a player and a gun. The gun points to where the mouse is, while it stays in place, rotating around the player.


But the problem I am facing is trying to flip the gun’s sprite when it reaches the player’s left side. Since I made the sprite pointing to the right, when pointing left, it is upside down. It would be as simple as getting the angle at which the sprite is rotated, and checking if it’s between 90 and 270 degrees, but I just can’t find a function like that.

:bust_in_silhouette: Reply From: ReudsFratt92

self.rotation? It’s in radians by default btw