SFML community forums

Help => System => Topic started by: dotty on January 22, 2012, 11:03:30 pm

Title: Do something every 10 frames
Post by: dotty on January 22, 2012, 11:03:30 pm
Hay, I'm using window.GetElapsedTime() to keep my framerate consistent across multiple computers.

How would I use this to see if 10 frames have passed? So every 10 frames do something?
Title: Do something every 10 frames
Post by: Elgan on January 22, 2012, 11:41:15 pm
how are you using it?

2.0?

surley count the frames between?
Title: Do something every 10 frames
Post by: dotty on January 23, 2012, 12:07:05 am
Yeah 2.0 and yeah I figured that soon after I posted this!
Title: Do something every 10 frames
Post by: TheEnigmist on January 23, 2012, 12:49:50 pm
With last 2.0 you need to use clock for elapsed time.
I'm not working on it, but i think we can do something like this:
Every n second/millisecond/microsecond do something...
Title: Do something every 10 frames
Post by: Tex Killer on January 23, 2012, 10:28:40 pm
Make a variable starting with 0, and at each frame add 1 on it.

When it is 10 or bigger, do what you want and subtract 10 of it.