Sep-25-2018, 06:18 PM
I would like to convert my joystick's two axis float (horizontal and vertical) to a 360 angle that can be used to set a players direction in my game. From my research, I've found the best route to take is using Atan2.
Variables:
![[Image: 6Ugnk.png]](https://i.stack.imgur.com/6Ugnk.png)
Absolutely any suggestions/snippets for the code would be amazing!
Variables:
self.rot = 0 horaxis = joy1.get_axis(0) veraxis = joy1.get_axis(1)Demonstration Diagram: you are correct, it is drawn in MS Paint
![[Image: 6Ugnk.png]](https://i.stack.imgur.com/6Ugnk.png)
Absolutely any suggestions/snippets for the code would be amazing!