Well, framerate independant movement is fairly easy..
Here's how I do it:
Code:
Procedure DoTimeKeeping;
begin
LastTim := Tim;
Tim := GetTickCount; //Replace GetTickCount with QueryPerformanceCounter if you need the extra resolution
T := (Tim-LastTim)/100; //replace the 100 with any magic number of your choice.
if T <= 0 then T := 0.01;
end;
Then when you have a button or object moving on the screen, you simply multiply it's velocity by T.
Code:
button.x := button.x + 0.5*T;
[/code]
Bookmarks