Search code examples
luamoai

Chaining moveLoc calls


I'm trying to chain a series of moveLoc calls, but I can't seem to do it without getting jerky/hitchy movements (in between calls).

-- executed in a separate thread
while moving do    
  action = prop:moveLoc(x, y, speed, MOAIEaseType.EASE_IN)
  MOAICoroutine.blockOnAction(action)  
  coroutine.yield() 
end

What I am trying to achieve is, have the prop continuously move by x, y with the speed under the condition that moving is true. (Also when moving is false, it is alright to finish up remaining movements, it does not have to stop on the point moving turns false)

The animation I'm seeing in the result pauses very now and then between the calls

Moves -> Stops -> Moves -> Stops -> Moves ...

How can I reduce the pauses in between moveLoc calls and have the prop move continuously?


Solution

  • Your probably want MOAIEaseType.LINEAR, or just use setLoc and update the position manually.