Hi, I have this enterFrame event listener:
Runtime:removeEventListener(“enterFrame”, updateScore )
Calling this function.
local function updateScore()
if gameActive then
score = score + 5
scoreTxt.text = "Score: " … score
scoreTxt:setReferencePoint(display.cl);
scoreTxt.x = 5
end
end
Basically it just updates the score all the time if gameActive is true. I’m just wondering, is it a waste of processing time when the game is paused (gameActive=false) that the EventListener still calls the function? It calls it but doesn’t do anything if gameActive=false, so was wondering if there is another way to do this? Or is this how it should work?
Thanks,
Mark