Is it intended that a repeating frame timer with a duration of
x runs for
x + 1 frames before starting over?
I create a simple frame timer that prints the frame for 4 frames and repeats.
t = playdate.frameTimer.new(4) t.repeats = true t.updateCallback = function (timer) print(timer.frame) end
1 2 3 4 0 1 2 3 4 0 1 2 3 4 and so on which means that it runs for
x + 1 frames before repeating again.
I understand that this comes from the fact that a non-repeating timer starts at
0 when set up and then updates for
x frames but when repeating I expected the last step in one repetition and the first step in the next to coincide.
I’m not asking to change it but if it’s intended, it would be good to mentioned it in the documentation because it took me a bit to figure out what’s going on.