好的,这是我目前的分数 - 计时器
local scoreTxt = display.newText( "Score: 0", 0, 0, "Helvetica", 40 )
scoreTxt:setReferencePoint(display.TopLeftReferencePoint)
scoreTxt.x = display.screenOriginX + 10
scoreTxt.y = display.screenOriginY + 32
local function updateScore()
score = score + 20
scoreText.text = string.format("Score: %d", score)
end
local scoreTimer = timer.performWithDelay(1000, updateScore, 0)
我希望那个计时器在什么时候暂停
function explode()
exp.x = bird.x
exp.y = bird.y
exp.isVisible = true
exp:play()
bird.isVisible = false
timer.performWithDelay(1500, gameOver, 1)
之后游戏重定向到你死了的屏幕,分数应该是可见的,但我希望它回到 0 时
function start(event)
if event.phase == "began" then
storyboard.gotoScene("game", "fade", 50)
end
end
那么,我该怎么做呢?