Hey!
I’m working on a game where the player controls a rocket.
There is a problem with the way the explosion works at the moment:
There are six explosion sprites that show up along the length of the rocket.
I tried to add a 10ms delay to the creation of each sprite (so they don’t start animating simultaneously), but it does not appear to work in this case.
Am I misunderstanding how timer.performWithDelay works or what is the problem right now?
Thank you for helping!
EDIT: The problem persists even when the delays are much longer.
[lua]local function createExp( expNumber )
– creates an explosion that is positioned along the rocket using expNumber
– (this part works fine, so I left it out)
end
local function rocketExplode()
createExp( 1 )
timer.performWithDelay( 10, createExp( 2 ) )
timer.performWithDelay( 20, createExp( 3 ) )
timer.performWithDelay( 30, createExp( 4 ) )
timer.performWithDelay( 40, createExp( 5 ) )
timer.performWithDelay( 50, createExp( 6 ) )
end[/lua]