Hello, I’m making a game and I have a timer that starts counting up once the level begins. Once the player reaches the final scene the time stops. This works fine, but what I’d like to do is have the final time recorded along with the final score (best time along high score). I’m able to record my score but I have no way of pulling the final time.
Here is the code from the scene where the timer starts (upon entering the scene).
currentTime = 0 local currentTimeText = display.newText(currentTime, 160, 20, native.systemFontBold, 24) currentTimeText:setTextColor(255,0,0) local function timerUp() currentTime = currentTime + 1 currentTimeText.text = currentTime
(I’m not even sure if that was done correctly).
Now here is the code on the final scene that stops the timer.
local time = timerUp timer.cancel(timerUpTimer) local time = timerUpTimer
This will stop the timer but I can’t figure out how to save the final time.
I’ve read all the documentation I could find online.
Any suggestions would be greatly appreciated.
Thank you.