Timers of type "for" do...

imagremlinimagremlin Member Posts: 4
edited December 2011 in Working with GS (Mac)
What exactly?
I've tried and they seem to run only once. I was expecting my code to be executed every frame for the specified time.

Comments

  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    "For" means it will run for only that amount of time and then stop running. What isn't working? There was a bug with the timers, but that has been fixed as far as I know. And what exactly do you mean by frame?

  • imagremlinimagremlin Member Posts: 4
    Frame as in Frames Per Second, every time the screen gets redrawn.

    This is what I did as a test:

    I created an actor.
    Put a "for" timer in.
    Set it for 5 seconds.
    Put a Log Debug statement in.
    Drop the actor in the first scene.
    Run the game.

    I get exactly one message on the debugger window.

    Can you elaborate on what you mean by "only that amount of time"? If i set the timer "for 5 seconds" how many times will it fire? How Often?
  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    For the timer:

    "Every" means that it will trigger whatever you put in that timer every so many seconds.

    "for" mean it will run whatever you've put in there for only that amount of time.
    If I said run for 5 seconds, start now..You would run for 5 seconds. That's it.

    Hope this helps
Sign In or Register to comment.