Thank you very much for the excellent answers. This did answer my question. I’ll try to clarify the problem, and share how I solved it so it helps others.
I’m afraid there’s a lot of code I would have to post so I’ll do my best to summarize… it is a tetris-esque game with a 2D array of tiles. Lots of events can cause tiles to move to different locations, based on timers, user input, or cascading effects from user input or timer.
The issue is that many of these events would move tiles by doing a transition.moveby, applying changes to both the X and Y properties. I was hoping that like some other animation systems I could feed in multiple simultaneous transitions and tiles would end up at the right place, but like both of you surmised it doesn’t work that way. Multiple transitions on the same object are not aware of each other and will fight instead of merging animations as they do on some other platforms.
The solution: for the affected tiles I tracked animation state on each object with a queue of X/Y changes to be applied, and an animation would be triggered or later executed as needed:
function moveRectBy(rect, targetX, targetY) if rect.animationQueueLength \> 0 then table.insert(rect.moveQueue, { x = targetX, y = targetY}) else rect.currentTransition = transition.moveBy(rect, { time = 500, x = targetX, y = targetY, transition = easing.outQuart, onComplete = moveRectByNext}) end rect.animationQueueLength = rect.animationQueueLength + 1 -- animationQueueLength includes animations in progress as well as those in the queue table end function moveRectByNext(obj) obj.animationQueueLength = obj.animationQueueLength - 1 if obj.animationQueueLength \> 0 then local nextMove = table.remove(obj.moveQueue, 1) obj.currentTransition = transition.moveBy(obj, { time = 500, x = nextMove.x, y = nextMove.y, transition = easing.outQuart, onComplete = moveRectByNext}) else obj.currentTransition = nil end end
(I have been in project management roles for a long time and this is my first time coding in years… so I am a bit embarrassed of my garbage spaghetti code. Hope it’s helpful to someone else.)