Search found 3 matches

by ignaciorojas16
Thu Aug 10, 2023 6:50 pm
Forum: Support and Development
Topic: [bug] sprite rotating towards at the mouse cursor
Replies: 4
Views: 857

Re: [bug] sprite rotating towards at the mouse cursor

BrotSagtMist wrote: Thu Aug 10, 2023 2:56 pm Horrible code demands horrible fixes:horidfix.love
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.
by ignaciorojas16
Thu Aug 10, 2023 6:47 pm
Forum: Support and Development
Topic: [bug] sprite rotating towards at the mouse cursor
Replies: 4
Views: 857

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...
by ignaciorojas16
Thu Aug 10, 2023 12:59 pm
Forum: Support and Development
Topic: [bug] sprite rotating towards at the mouse cursor
Replies: 4
Views: 857

[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...