Hey everyone, I am profoundly stuck with such an easy dilema. I am almost done with my game but I have one slight problem. I have a showMole code which makes the “mole” popout, which you are supposed to hit it on time or loose a life. However, now I want to add a display.image icon which, when hit, gives a life back. This is my showMole function:
local function showmole() lastmole.isVisible = false local randomHole = math.floor(math.random() \* 1) + 1 lastmole = moles[randomHole] lastmole:setReferencePoint(display.BottomCenterReferencePoint) lastmole.yScale = 0.1 lastmole.isVisible = true transition.to(lastmole, { time=300, yScale=1 }) end
However, I want a seperate function which using a timer.delay randomly pops my “lifeicon” so the player has a chance to recover a life. I understand I can do it within this showMole function but the “lifeicon” would popout where the moles do, which won’t make my game run as I want it.
ANY IDEAS? Much appreciated!