Is possible move a sprite to new angle using lerp?
I have 1 Global number variable for angle to sprite.
in a event, I setting the new number on variable, and sprite change hers angle, but not use lerp...
thank you very much and sorry for my English
<img src="smileys/smiley3.gif" border="0" align="middle" />
Develop games in your browser. Powerful, performant & highly capable.
Set angle to lerp(self.Angle, x, dt) where x is a positive number from 0 - 360 or use anglelerp(a, b, x).
It depends what you want.
Use anglelerp(a, b, x) instead for angles.
Edit - got ninja'd
there's literally an expression called 'anglelerp' that works exactly like lerp, except it takes into account the sudden jump from 360 to 0 degrees.. so it always does the shortest turning
(or 180 to minus 180, rather)
edit: forgot to refresh tab and got double ninja'd by twenty whole minutes.