Ok, I think I understandOriginally Posted by PyroGine Development
Expanding on this, I have a bunch of other objects in my game that I want to control using the elapsed frame time in seconds (or fractions thereof) by passing in this time into their .Update() method...
To pass in the number of seconds into these methods, do I do this kind of thing?
[pascal]
var
TimeSlice: Single;
begin
TimeSlice := 1.0 * aElapsedTime / PG.Timer.DesiredFPS;
...
MyObject.Update(TimeSlice);[/pascal]
I'm hoping this will pass in a time I can then compare to, let's say 1 = 1 second, 0.010 for 10ms?
EDIT: just so you know, the fix for my global game time now works lovely thanks to you
[pascal] FTimeCount := FTimeCount + (1.0 * aElapsedTime);
if FTimeCount >= PG.Timer.GetDesiredFPS then begin
FTimeCount := 0;
Inc(FTime.Seconds);
if FTime.Seconds >= 60 then begin
FTime.Seconds := 0;
Inc(FTime.Minutes);
if FTime.Minutes >= 60 then begin
FTime.Minutes := 0;
Inc(FTime.Hours);
end;
end;
end;
[/pascal]
cheers,
Paul
Bookmarks