イベントが発生したときにスコアのカウントを停止するトリガーが欲しいのですが、
function restartStopScore()
score = score + 0
end
動作しないでしょう
score = 0
local scoreText = display.newText( "Score: " .. score, 20, 20,nil, 40)
scoreText:setTextColor(255,255,255)
local function getScore() -- increments Speed value every time it is called
score = score + 1
scoreText.text = "Score: " .. score
print("score" .. score)
end
timer.performWithDelay(1000, getScore, 0)
function restartScore()
--reset the score
score = 0
end
timer.performWithDelay(5000, restartScore, 1)--test trigger reset the score