Hi, my question is about making a 'game' run at the same speed on many different computers.
I'm using a computer with a screen refresh rate of 60Hz. Currently I get everything done within the frame, so that the game works smoothly.
I only have a P3 600Mhz with an LCD at 60Hz. I've heard quoted that monitor refresh can be a lot faster than 60Hz which would make my game probably run faster than what it should.
Basically I'd like to know how to make the game work at the same speed on any computer and have smooth animation.
I've had a look at some games sources and they do something like the following.
GameTimer = CreateTimer(30)
NoOfUpdates = WaitTimer(GameTimer)
For Count=1 To NoOfUpdates
UpdateGame()
Next
RenderGame()
Can someone explain this a little bit? Or point me in the right direction?
Thanks
Marg
I'm using a computer with a screen refresh rate of 60Hz. Currently I get everything done within the frame, so that the game works smoothly.
I only have a P3 600Mhz with an LCD at 60Hz. I've heard quoted that monitor refresh can be a lot faster than 60Hz which would make my game probably run faster than what it should.
Basically I'd like to know how to make the game work at the same speed on any computer and have smooth animation.
I've had a look at some games sources and they do something like the following.
GameTimer = CreateTimer(30)
NoOfUpdates = WaitTimer(GameTimer)
For Count=1 To NoOfUpdates
UpdateGame()
Next
RenderGame()
Can someone explain this a little bit? Or point me in the right direction?
Thanks
Marg