every 1 second

Get help using Construct 2

Post » Tue Apr 17, 2012 7:31 pm

"Every X seconds" is not affected by the framerate - it runs based on real-world time rather than ticks.

However, I think a few people are being thrown off by a current bug in Chrome 18. If there is nothing changing on the screen, the game will start running at hundreds of frames per second and the timers all screw up. The fix is to make sure you change something every frame - try just putting an unused text object outside the layout and always set it to tickcount to fix it.

The problem should not happen in any other browser and is also fixed already in Chrome 19 so should disappear in a few weeks.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Tue Apr 17, 2012 7:57 pm

Ashley, I'm trying to use the factors to come up with everytick in milliseconds, just by multiply 60*Xquantity of seconds (which is the rate of frames per second)
B
123
S
19
G
16
Posts: 487
Reputation: 21,498

Post » Wed Apr 18, 2012 4:15 am

Oh wow, haha. My apologies for the blatant misinformation. I took the tid-bit about "intervals being limited by the frame-rate" to mean that the counter is dependent of the frame rate.
B
14
Posts: 5
Reputation: 587

Post » Wed Apr 18, 2012 7:15 am

I had only the text showing a number in that capx I posted, and the framerate was at between 100 and 700, so I guess that's the bug Ashley mentioned
B
83
S
21
G
15
Posts: 1,039
Reputation: 15,134

Post » Thu Apr 19, 2012 12:36 am

[quote=Ashley]"Every X seconds" is not affected by the framerate - it runs based on real-world time rather than ticks.

However, I think a few people are being thrown off by a current bug in Chrome 18. If there is nothing changing on the screen, the game will start running at hundreds of frames per second and the timers all screw up. The fix is to make sure you change something every frame - try just putting an unused text object outside the layout and always set it to tickcount to fix it.

The problem should not happen in any other browser and is also fixed already in Chrome 19 so should disappear in a few weeks.[/quote]

Thanks a lot for this.
I was actually going mad over it already, as my timer would decrease at a random speed when idle'ing.
B
6
S
1
Posts: 54
Reputation: 958

Previous

Return to How do I....?

Who is online

Users browsing this forum: SpartCrafter, Yahoo [Bot] and 24 guests