Sign in to follow this  

SFML How to make a timed game loop?

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

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