Archived

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

foonk

acceleration...

Recommended Posts

hey i''ve been thinking about how to make a object accelerate kind of like a car, would, and soon reliesed i would need to use a timer, so then if your computer is faster it wont speed the acceleration up, anyway i was wondering if you guys have any tips on doing this, or a good place to read up about timing in game etc. thanks for anything that help. m

Share this post


Link to post
Share on other sites
This is basically how timing works:

During initialization you save the current time.
lasttime = gettime();

Each frame you do this:
frametime = (currenttime = gettime()) - lasttime;
lasttime = currenttime;

You should of course use the best clock you have on the system, such as a high performance multimedia counter (timeGetTime in windows.)

Share this post


Link to post
Share on other sites