Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.



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

Hey! I got a question about the timing and speed in games... If I just define the moving speed, without any time controlling(no delays or anything like that), the objects will move faster on a fast computer than on a slow one, right? So do you have any tips how to get the movements be the same att different computers... // Jonas Ericsson

Share this post

Link to post
Share on other sites
Two ways you can limit the frame rate so you know the maximum number of frames per sec like this

DWORD Timer = GetTickCount();
// Insert frame code

while(GetTickCount() - Timer < 33)

This limits your program to 33 frames per second.
However for 3D Graphical games this is not often used (atleast not as far as I know). What you do is keep track of how much time the last frame took and then use this to work out how far the model/s should move such as:

Movement = MovementDistance * DeltaTime;

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!