Adding finishing touches to my entry to the Techority 48 hour challenge, and I thought I want to add a splash after water balloon object has been hit.
[lua]elseif self.name == “coinShot” and event.other.name == “balloon” and gameIsActive then
score = score + 3
scoreText.text = "score: "…score
scoreText.x = 250
audio.play(water_balloon_sound)
event.other.currentFrame = 2
timer.performWithDelay( 1000, table.insert(toRemove, event.other), 1)[/lua]
In this case if I remove the timer, the balloon turns into the splash when hit, but doesnt get destroyed. So I added the timer, which I want to destroy the balloon after 1 second. But with the timer added, it doesn’t wait, and it destroys the balloon immediately without switching to the second fram of the sprite sheet.
Is it not possible to do the following?
[lua] timer.performWithDelay( 1000, table.insert(toRemove, event.other), 1)[/lua]
Thanks in advance
[import]uid: 7116 topic_id: 22437 reply_id: 322437[/import]