acceleration...
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
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.)
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
Popular Topics
Advertisement
Recommended Tutorials
Advertisement