Vector into Float
Showing the player the direction of their spit using an arrow involved the challenge of taking a 2D vector (the position of the thumbstick) and making it into a float to use as the rotation of the sprite. I had a vague idea of how this would work, as the origin of the thumbstick and its current x-position and y-position would make a right-angled triangle, allowing the use of trigonometry to calculate the angle.
What I started I thought that I would need to use the sine and cosine of y and x respectively, but after this didn’t work, I realised that I only needed to calculate the angle using the x position, and only use the y position to determine whether the angle is more or less than 180 (or pi, because rotation in ASGE uses radians).