It looks like a timer’s value keeps updating even after it’s been paused? I expected it to not change after :pause() was called, and to only begin incrementing again after calling :start()
I put together a minimal repro - if you press A and check the console output you will see the value incrementing normally, but if you press A again, wait for a couple of seconds, and press A once more, you will notice the value has jumped as though the timer was never paused.
local timer = playdate.timer.new(12000, 1, 1000)
timer.updateCallback = function ()
print('timer update', timer.value)
timer.timerEndedCallback = function ()
print('timer end', timer.value)
local isPlaying = false
if isPlaying then
isPlaying = false
isPlaying = true
For now, editing CoreLibs/timer.lua so that the :start() function sets the timer’s _lastTime value back to nil seems to work:
self._lastTime = nil
self.paused = false
I'm working on a game and I have this issue but I am not 100% sure how to edit the core libs timer file. Can you expand on how to update the core libs timer file so the timers work correctly? I looked for other threads but I cannot find anything. Appreciate any help, I have come a long way on my project just from looking at threads like this. Timers are the bane of my existence right now so I would love to get this right, I have the pause code written perfectly but my timer always resets!