Advertisement
ShiroX

Untitled

Sep 19th, 2015
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. //Path start:
  2. pathPosition = 0;
  3. pathSpeed = 6;
  4. action = actionPath;
  5. currentPath = argument0;
  6.  
  7. //Path Step:
  8. pathPosition = pathPosition + (pathSpeed / path_get_length(currentPath))
  9. if(pathPosition >= 1){
  10. action = actionRoll;
  11.  
  12. var previousX = path_get_x(currentPath, pathPosition-(pathSpeed / path_get_length(currentPath)));
  13. var previousY = path_get_y(currentPath, pathPosition-(pathSpeed / path_get_length(currentPath)));
  14. currentPath = -1;
  15. XSpeed = pathSpeed * cos(degtorad(point_direction(previousX, previousY, pathPosition.x, pathPosition.y));
  16. YSpeed = pathSpeed * -sin(degtorad(point_direction(previousX, previousY, pathPosition.x, pathPosition.y));
  17. else{
  18. x = path_get_x(currentPath, pathPosition);
  19. y = path_get_y(currentPath, pathPosition);
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement