Game Timing

BlitzMax Forums/BlitzMax Programming/Game 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.

I seem to fix the collision detection and everything is working fine with one exception. There seems to be a difference in the rotation velocity when I set the game to 30 FPS and 85 FPS. I must not have the delta time in the right place?

Have a look at the code and see if you have any advide:


TurnSpeed:-TurnAcceleration * TDelta.GetTime()
		
'Limit TurnSpeed
If TurnSpeed < -TurnMax TurnSpeed = -TurnMax

'Apply Friction To Rotation
If TurnSpeed >  TurnFriction   
TurnSpeed:- TurnFriction * TDelta.GetTime() 
End If           
		
If TurnSpeed < -TurnFriction
TurnSpeed:+ TurnFriction * TDelta.GetTime()
End If
		
'If Friction is Greater than Speed Then Stop
If TurnSpeed < TurnFriction and TurnSpeed > -TurnFriction TurnSpeed = 0


Thanks