ThatSnail

Untitled

Mar 29th, 2013
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var target_dir;
  2. target_dir = point_direction(x,y,mouse_x,mouse_y);
  3.  
  4. if(abs(phy_rotation - target_dir) > 180){phy_rotation -= sign(phy_rotation - target_dir) *360;}
  5.  
  6. var old_phy_rotation;
  7. old_phy_rotation = phy_rotation;
  8. phy_rotation = (lerp(phy_rotation,target_dir,0.025));
  9.  
  10. // check if overshot
  11. if(sign(phy_rotation - target_dir) != sign(old_phy_rotation - target_dir))
  12. {
  13.     phy_rotation = target_dir;
  14. }
  15.  
  16. thrust_angle = degtorad(image_angle);
Advertisement
Add Comment
Please, Sign In to add comment