I’m making a game which monitors how far a person swipes on their phone. I only need to capture the data if they are swiping downward (from top of phone toward bottom). The way the coordinate system works, the 0,0 point is in the lower left of the screen, and the y value at the top of the screen is about 420.
What I need to is capture the starting position, the current position as they drag down with their finger, and as they drag, calculate the difference of these two numbers in order to rotate an object (to a maximum rotation of 180 degrees). So essentially it would be something like:
If swipe direction is downward:
object rotation equals difference between start position and current position with a min of 0 and a max of 180. Anybody know how to write a formula for that?