Mail Archives: djgpp/1999/10/18/18:00:29
On Sun, 17 Oct 1999, you wrote:
> Hello everybody
>
> I programmed a simple game in C.
> (I used DJGPP and ALLEGRO)
> But the game runs on different Computers with
> a different speed.
> Is it possible, that the game runs on all
> Computers with a similar speed ?
> Please Help me immidiately .
In Allegro you can use a timer routine... what that is, is a function that is
called every, say 30 ms, (you can specify the rate). That function increments a
global variable every time it is called. In your program, all you have to do is
check that variable and see if it is '1' yet. If it is still '0', then loop
until it is '1'. When it equals or is above '1', run a loop of your game, and
set the variable back to 0.
There is an example of this in some of the examples that came with allegro, I
can't remember which one, but it is in there.
--
Jared Stevens
- Raw text -