My game is supposed to have an object that changes it sprite depending on which way the mouse faces. programming this has become a challenge, because I want to calculate the angle relative to the center of the screen using the X axis.
To explain what I mean, pretend that under a sprite in the center of a screen is a protractor.
I want to measure the angle that's formed between the cursor and the center. If I use the X axis as a base, I should get an angle between 180° and -180°.
How would I achieve this? I've tried
vector.angle(reference-vector), but that doesn't seem to give the desired result.