Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var target_dir;
- target_dir = point_direction(x,y,mouse_x,mouse_y);
- if(abs(phy_rotation - target_dir) > 180){phy_rotation -= sign(phy_rotation - target_dir) *360;}
- var old_phy_rotation;
- old_phy_rotation = phy_rotation;
- phy_rotation = (lerp(phy_rotation,target_dir,0.025));
- // check if overshot
- if(sign(phy_rotation - target_dir) != sign(old_phy_rotation - target_dir))
- {
- phy_rotation = target_dir;
- }
- thrust_angle = degtorad(image_angle);
Advertisement
Add Comment
Please, Sign In to add comment