Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Do something every 10 frames  (Read 3109 times)

0 Members and 1 Guest are viewing this topic.

dotty

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
Do something every 10 frames
« 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?

Elgan

  • Jr. Member
  • **
  • Posts: 77
    • AOL Instant Messenger - Flat+1,+17+st+Cl
    • View Profile
Do something every 10 frames
« Reply #1 on: January 22, 2012, 11:41:15 pm »
how are you using it?

2.0?

surley count the frames between?

dotty

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
Do something every 10 frames
« Reply #2 on: January 23, 2012, 12:07:05 am »
Yeah 2.0 and yeah I figured that soon after I posted this!

TheEnigmist

  • Full Member
  • ***
  • Posts: 119
    • View Profile
Do something every 10 frames
« Reply #3 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...

Tex Killer

  • Full Member
  • ***
  • Posts: 242
    • View Profile
Do something every 10 frames
« Reply #4 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.

 

anything