Timer
Moderator: Moderators
I don't get it, is the timer not executing once per frame? Since the fps-interval setting isn't guaranteed to take exactly 1 second per frame (there will always be small deviations depending on Windows timer resolution), the timer will probably sometimes skip one frame and execute the next. If you want it to execute once per frame, try setting it to 0.95 or something like that.
You shouldn't use the Timer Component for precision critical behavior. Attached is a example of a frame-independent timer ( top ) versus the Timer Component ( bottom ) both running at a interval of 0.125. The framerate is automatically varied in the 10-30 range.
K
- Attachments
-
- Timer.zip
- (30.29 KiB) Downloaded 486 times
Last edited by Kjell on Wed May 05, 2010 3:24 pm, edited 1 time in total.
OK, whatever. I just came across this while trying to fine tune my animation.
It doesn't matter how many frames per second - at timer 1 second interval, it updates once for every 10 position updates. Here it is running at 5 frames per second. It just looked like a misplaced decimal point somewhere.
It doesn't matter how many frames per second - at timer 1 second interval, it updates once for every 10 position updates. Here it is running at 5 frames per second. It just looked like a misplaced decimal point somewhere.
- Attachments
-
- animSprite_3.zip
- (53.86 KiB) Downloaded 481 times
"great expectations"
ZGameEditor's time delta has a limit of 0.1. This means that as soon as the framerate drops below 10 fps your application starts slowing down* So it's not a bug .. although it would be nice if the threshold was a property of App ( so you can increase it for debugging purposes like yours ).
*For example, your character itself doesn't move as fast as it does with any framerate above 10 either.
K