• Advertisement
Sign in to follow this  

SFML How to make a timed game loop?

This topic is 2917 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

While learning SFML, I have started to create a pong clone. Currently, I just render a square on the screen that's going to be the ball. I set the maximum framerate to 60. I noticed in a previous example that for instance if you apply a rotation to increment in the game loop, and then speed up/slow down the maximum framerate, it affects the speed of the rotation. Is there a way to make the game's processing or update speed different from the framerate? Like let's say over the period of 10 seconds, the box moves 1000 pixels to the right. Whether the user be using an ancient video card, and can only run 20 fps, or have an up to date machine running 60, I'd like the box to move the same amount in the same time frame. It would just be less smooth obviously. Is there a way to do that?

Share this post


Link to post
Share on other sites
Advertisement
hey thanks :), finally had a chance to get back at this. Referred to the tutorial here as well: http://www.sfml-dev.org/tutorials/1.5/window-time.php to get an idea of how that works.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement