This should be quick question for anybody who can help me out here. In my game I have a couple of power ups. Some are one time things like extra life or added points, but some are score multipliers. I would like some guidance in how to make a sort of timer so that a powerup lasts for maybe 15 seconds and then goes away. This is what a section looks like right now:
if (powerUpNumber == 1) then
scoreDoubleBar = display.newImage("scoreDoubleBar.png")
scoreDoubleBar.y = 40
transition.from(scoreDoubleBar, {alpha = 0})
doubleScoreMode = true
end
if (powerUpNumber == 2) then
scoreTripleBar = display.newImage("scoreTripleBar.png")
scoreTripleBar.y = 40
transition.from(scoreTripleBar, {alpha = 0})
tripleScoreMode = true
end
So it would be something like if power-up number one was chosen, the scoreDoubleBar (which is a picture) would appear and the scoreDoubleMode would turn on. Then after 15 seconds, scoreDoubleBar would scoreDoubleBar:removeSelf() and scoreDoubleBar would be false.
Thanks for your time! [import]uid: 7116 topic_id: 12257 reply_id: 312257[/import]
[import]uid: 52491 topic_id: 12257 reply_id: 44655[/import]