I have a code that should prevent the game from going too fast, but it's not quite working.. here it is:
[To sum up the above, it finds out how long it's taking to render one loop, then comparing it to how long it should take, then delaying for the right amount of time]
what's wrong with the above? It DOES limit the fps, but it still allows it to go about 10 fps over the SyncRate value!
how can I make it more percise?
SyncRate = 30 while not keydown(1) RenderTime = MilliSecs() - RenderStart renderStart = MilliSecs() If Rendertime<(1000/syncrate) Then temp = (1000/syncrate) - Rendertime: Delay temp UpdateWorld RenderWorld Flip wend end
[To sum up the above, it finds out how long it's taking to render one loop, then comparing it to how long it should take, then delaying for the right amount of time]
what's wrong with the above? It DOES limit the fps, but it still allows it to go about 10 fps over the SyncRate value!
how can I make it more percise?