Sign in to follow this  

In a game, would you only use 1 timer?

This topic is 4662 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

That depends entirely on the game. In Tetris, for example, you need one timer for the framerate, and another timer for the dropping blocks. If you have sprites, you will need a timer for when the animation changes. Just add as many as you need.

Share this post


Link to post
Share on other sites
You should have at least one system (real) timer and one game (virtual) timer. Why ? You should be able to freeze and unfreeze the game timer at will. For instance when you enter a breakpoint in debug mode. Ever experienced this : you debug, possibly edit, then continue and your physics get completly unstable because they suddenly have to deal with unmanageable long time deltas. Your game timer can for instance decide to clamp any real delta of time between two game loops superior to 0.1 seconds. This will have the effect of freezing the game when you enter a break point.

Share this post


Link to post
Share on other sites

This topic is 4662 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this