Timer resume issue

Hello Community,

I’m developing a game that involves pausing ang resuming timers. I think, and I hope it is not, there’s a bug in resuming timer. Here’s a substitute of my game. It is simple but why is it not showing the number I’m expecting?

[lua]local function timerExercise()
local timers = {}

for counter = 1, 50 do
timers[counter] = timer.performWithDelay( 2000 + (counter * 1000), function ()
print (“Timer #”…counter)
if counter == 5 then
for countme = counter + 1, #timers do
if timers[countme] ~= nil then
print (“PAUSE! #”…countme…" - "…timer.pause(timers[countme]))
end
end
timer.performWithDelay(5000, function()
for countme = counter+1, #timers do
timer.resume(timers[countme])
end
end)
end
end)
end
end

timerExercise()[/lua]

what i’m expecting as a result is printing first 6…7…8…9 and so on. What it is displaying is 6-11 together then 7-12…13-18… why is this? this timer is very crucial for my game. Please Help. [import]uid: 141531 topic_id: 26087 reply_id: 326087[/import]

Hello again,
I have solved my problem but did not use timer.performWithDelay as my function. I used the beebegames timer which is object.performAfterDelay and paused it by using object.pauseAllTimer() but the timing sucks, really suck. Though i appreciate what they did in creating this ffeature and it is great but the timing really is not that accurate.

Gonna do research on this it might be speed or something still dont know.

And please take a look at my post if there are a fix on this. So far beebegames, i’m still not satisfied on the timer.

Thanks all.
Regards, Ronel [import]uid: 141531 topic_id: 26087 reply_id: 105660[/import]

Hey there,

Yes, in 704 timer.pause/timer.resume had some issues I believe, they should have been fixed since.

You can confirm that by checking out the notes on changes since the last stable release here; http://developer.anscamobile.com/corona-daily-builds/summary

Peach :slight_smile: [import]uid: 52491 topic_id: 26087 reply_id: 105811[/import]

Aww, is there other alternative on this? Except beebegames’ timer. Like I said, timer is very crucial to what i’m trying to do.

Ronel. [import]uid: 141531 topic_id: 26087 reply_id: 105816[/import]

When you become a licensed Corona developer you will then be able to use it - while you are testing out Corona with a trial license to see if it meets your needs then Beebe’s games class is a very useful alternative for many things.

Peach :slight_smile: [import]uid: 52491 topic_id: 26087 reply_id: 105974[/import]