A little help?

I have a an image which is called “box”, that image has a “tap” event listener, when you tap it this function is ran:

function destroyBox() playPop = audio.play(popSound) score = score + 1 scoreText.text = score boxSpawned = 0 box:removeSelf() spawnBox() end 

How can I make a check so that every tenth time the box is tapped you get 1 coin?

Thanks.

I would do something like that (not tested)

-- Create box local box = ... -- Listener function box:tap( event )     ...     self.numTaps = ( self.numTaps or 0 ) + 1     if self.numTaps % 10 == 0 then         -- Give 1 coin:)     end end function destroyBox()     playPop = audio.play(popSound)     score = score + 1     scoreText.text = score     boxSpawned = 0     local numTaps = box.numTaps     box:removeSelf()     spawnBox( numTaps ) end  local function  spawnBox( numTaps )     ...     box.numTaps = numTaps end

Instead of destroying box you try hide it?

Well I’m new to Lua and the Corona SDK and this is my first game just to really see how everything works.

Thanks for your help.

TutorialIntroduction to Corona is good place to start.

I would do something like that (not tested)

-- Create box local box = ... -- Listener function box:tap( event )     ...     self.numTaps = ( self.numTaps or 0 ) + 1     if self.numTaps % 10 == 0 then         -- Give 1 coin:)     end end function destroyBox()     playPop = audio.play(popSound)     score = score + 1     scoreText.text = score     boxSpawned = 0     local numTaps = box.numTaps     box:removeSelf()     spawnBox( numTaps ) end  local function  spawnBox( numTaps )     ...     box.numTaps = numTaps end

Instead of destroying box you try hide it?

Well I’m new to Lua and the Corona SDK and this is my first game just to really see how everything works.

Thanks for your help.

TutorialIntroduction to Corona is good place to start.