Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Path start:
- pathPosition = 0;
- pathSpeed = 6;
- action = actionPath;
- currentPath = argument0;
- //Path Step:
- pathPosition = pathPosition + (pathSpeed / path_get_length(currentPath))
- if(pathPosition >= 1){
- action = actionRoll;
- var previousX = path_get_x(currentPath, pathPosition-(pathSpeed / path_get_length(currentPath)));
- var previousY = path_get_y(currentPath, pathPosition-(pathSpeed / path_get_length(currentPath)));
- currentPath = -1;
- XSpeed = pathSpeed * cos(degtorad(point_direction(previousX, previousY, pathPosition.x, pathPosition.y));
- YSpeed = pathSpeed * -sin(degtorad(point_direction(previousX, previousY, pathPosition.x, pathPosition.y));
- else{
- x = path_get_x(currentPath, pathPosition);
- y = path_get_y(currentPath, pathPosition);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement