Advertisement

Slowing down your game

Started by November 13, 2000 08:57 PM
1 comment, last by Peon 24 years, 2 months ago
What is an easy way to slow down a game? I used GetTickCount and stuff but it was WAY too fast... I tap the button to move (which moves one pixel at a time) and it jumped from 150 to about 14000. It needs to be around a lot less, lol. And Sleep() won''t allow input to continue, right? How would I solve this problem (or what function should I look into?)
Peon
Doh, nevermind! I was doing:

while ((GetTickCount - StartTime) < 33)
{
GameMain();
}

as opposed to:

while ((GetTickCount - StartTime) < 33);

stupid, stupid
Peon
Advertisement
Instead of slowing it down, set a rate in pixel/sec and multiple the elapsed time by this rate.

That way faster machines & hardware can use thier extra horsepower for higher framerates, instead of a tight cpu tick sucking loop

and if winblows time slices you, it''ll still work out right...
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara

This topic is closed to new replies.

Advertisement