you're right, i am new in this of game making, i just need to practice so i can improve, thanks also for helping me.
Search found 3 matches
- Thu Aug 10, 2023 6:50 pm
- Forum: Support and Development
- Topic: [bug] sprite rotating towards at the mouse cursor
- Replies: 4
- Views: 920
Re: [bug] sprite rotating towards at the mouse cursor
- Thu Aug 10, 2023 6:47 pm
- Forum: Support and Development
- Topic: [bug] sprite rotating towards at the mouse cursor
- Replies: 4
- Views: 920
Re: [bug] sprite rotating towards at the mouse cursor
You are need to calculate the smallest absolute angle as local clockwise = (360 + (angle1 - angle2)) % 360 local counterclockwise = (360 - (angle1 - angle2)) % 360 if clockwise > counterclockwise then rotate (deltaAngle) else rotate (-deltaAngle) end Not tested, maybe change direction or change 360...
- Thu Aug 10, 2023 12:59 pm
- Forum: Support and Development
- Topic: [bug] sprite rotating towards at the mouse cursor
- Replies: 4
- Views: 920
[bug] sprite rotating towards at the mouse cursor
Hi! i am working in a project where i use physics. in it, a circle body with a sprite of a ship that rotates towards the mouse cursor using trigonometry. Works by applying torque to the body according to the position of the mouse cursor, while the sprite rotates at the same angle of the body. Previe...