IIRC lagcount is the equivalent of frametime.
ie player.x := player.x +1 * lagcount should work for you when using dxtimer.
Alternatively, when using your own gameloop (for example in the application.onIdle event.) the method I wrote above works.
Here's some sample code too (note: I haven't actually compiled it so it may contain a syntax error, but I'm sure it'll get the point across)
Code:
procedure mainloop();
begin
finished := False;
gameStart := GetTickCount(); // Get Time when demo started
while not finished do
begin
LastTime := ElapsedTime;
ElapsedTime := GetTickCount() - gameStart ; //Calculate Elapsed Time
ElapsedTime := (LastTime + ElapsedTime) div 2;
{.. your other stuff in here...}
player.x := player.x + player.xspeed * ElapsedTime
{.. your other stuff in here...}
end;
end;
That avatar of yours is freaking me out by the way
Wait until you see the next one
Bookmarks