I want to put a max touch to the screen when the user touches it . If the user touches the screen 10 times then they have to go to a scene to watch a add to continue playing or pay to continue playing but I am having trouble with that . When I touch the screen 10 times it doesn’t do anything . Any help ?
function touchScreen( event ) if ( event.numTouch == 10 ) then storyboard.gotoScene("maxtap", "fade", 400) else return true end end function onBallTap( event ) storyboard.gotoScene("restart", "fade", 400) return true end function scene:enterScene(event) storyboard.purgeScene("restart") storyboard.removeScene("maxtap.lua") Runtime:addEventListener( "touch", touchScreen ) end function scene:exitScene(event) Ball:removeEventListener( "tap", onBallTap ) Runtime:aremoveEventListener( "touch", touchScreen ) end function scene:destroyScene(event) end scene:addEventListener("createScene", scene) scene:addEventListener("enterScene", scene) scene:addEventListener("exitScene", scene) scene:addEventListener("destroyScene", scene) return scene