I apologize if this is addressed somewhere but my search came up blank.
I'm creating a Point and Click game. I can move my animated sprite character to a 'new' touch point with no problem.
I want to be able to set the facing direction (1 or 8 possible) of the sprite animation when a touch occur. So I'm trying to find out if the new touch was North, North East, East, South East, etc from the current sprite X,Y location give the touch X,Y. Then I can set the correct offset in sprite sheet.
I suspect this involves using the math.arctan2() and/or math.deg() but not sure. Maybe there is an easier way.
I remember seeing a youtube tutorial game years ago with code but I cannot find it now!
Can someone point me to a code example?
Thank you in advance.
You can email me a email@example.com if you like and/or respond here.