Delta Timing

Miscellaneous Forums/General Discussion/Delta Timing

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Global delta#
Global render_time
Global FPS#=30
Global TimePerFrame#= (1000.0 / FPS#)

;multiply all time based variables by delta#
;such as speed .... speed = distance * time

Function CalcTimer()
ms_passed#=MilliSecs()-render_time
render_time=MilliSecs()
delta#=(delta#*4.0 + Float(ms_passed#/ TimePerFrame#))/5.0
If delta# >2 Then delta#=2
End Function