You’re running into an issue where the top level code in a scene module does not re-execute when the scene is revisited. So this line:
local secondsLeft = 20 * 60 – 20 minutes * 60 seconds
Will only ever execute once unless you remove the scene. What you need to do is inside the scene:show() function reset the value. Assuming you leave that line near the top of the scene and do this:
function scene:show( event ) local sceneView = self.view if event.phase == "will" then secondLeft = 20 \* 60 -- or whatever value you want end end
Then each time you re-enter the scene the value will reset.
The line:
--composer.removeScene( "scene",true)
if you blindly put that in, won’t do anything. The two minus-signs (–) say "Comment this line out and ignore it
Next “scene” is going to try and remove a scene that is in the “scene.lua” file. It doesn’t make sense to have a scene named “scene”.
Rob