So I’ve looked at:
https://coronalabs.com/blog/2014/01/07/tutorial-moving-objects-along-a-path/
and I downloaded the code, all I really want to do is for the object to continue following the path forever. I don’t know why but my brain has ran out of ways to do this today. I was thinking about having a boolean flag and a while loop per:
while (repeating == true) do for i = 1,#path do local segmentTime = 500 --if "constant" is defined, refactor transition time based on distance between points if ( constant ) then local dist if ( i == 1 ) then dist = distBetween( object.x, object.y, deltaX+path[i].x, deltaY+path[i].y ) else dist = distBetween( path[i-1].x, path[i-1].y, path[i].x, path[i].y ) end segmentTime = dist\*speedFactor else --if this path segment has a custom time, use it if ( path[i].time ) then segmentTime = path[i].time end end --if this segment has custom easing, override the default method (if any) if ( path[i].easingMethod ) then ease = path[i].easingMethod end transition.to( object, { tag=tag, time=segmentTime, x=deltaX+path[i].x, y=deltaY+path[i].y, delay=delay, transition=ease } ) delay = delay + segmentTime end end
but that very quickly causes a crash. Open to any suggestions, I’m outta ideas.