Game Maker Games, Articles, Tutorials & More

Game Maker Network


Howdy, Guest! Please sign in or register an account.

Print

rotate_toward

By Daniel · December 24, 2008

Rotate some angle toward some other target angle with a given speed

// rotate_toward(dirOld, dirNew, rotSpeed)
return argument0 + sign(sin(degtorad(argument1 - argument0))) * min(argument2, abs(((((argument0 - argument1) mod 360) + 540) mod 360) - 180));

Categories: Motion

Comments

There are no comments to display.

Post a Comment

You must be signed in to post comments.

Advertisement