acceleration...

Started by
0 comments, last by foonk 22 years, 2 months ago
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
Advertisement
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.)
--------------------------------"I'm a half time coder, full time Britney Spears addict" Targhan

This topic is closed to new replies.

Advertisement