How to orchesrate a series of effects?

Hi,

In my game, an item’s effect is to pause the game, fade-in a a white screen, show an animation, move that object to several locations on the screen, fade-out the white screen, un-pause the music and un-pause the physic but my problem is how to do chain them.

I wanted to do all of them with timer.performWithDelay and it’s what I’ve done so far:

physics.pause() sfxManager.pauseMusic() timer.performWithDelay(10, function() whiteScreen.alpha = whiteScreen.alpha + 0.1 end, 20) timer.performWithDelay(10, function() whiteScreen.alpha = whiteScreen.alpha - 0.1 end, 20) timer.performWithDelay(3000, function() sfxManager.playMusic() end) timer.performWithDelay(3000, function() physics.start() end)

But since I’m using timer for fade-in, I can’t chain other effects to it since they will start at once.

Thanks.

Why not use transition.to() and use its onComplete to chain another effect and use timers when necessary to run things that have to happen outside the transition.

That’s good, only if I could chain timers, instead of starting them all at once and offset them.

Why not use transition.to() and use its onComplete to chain another effect and use timers when necessary to run things that have to happen outside the transition.

That’s good, only if I could chain timers, instead of starting them all at once and offset them.