From: "Damian Yerrick" Newsgroups: comp.os.msdos.djgpp Subject: Re: Game Speed Date: Sun, 17 Oct 1999 23:36:06 -0500 Organization: Rose-Hulman Institute of Technology Lines: 46 Sender: AFSAUTH AT yerricde DOT laptop DOT rose-hulman DOT edu Message-ID: <7ue86s$ibv$1@solomon.cs.rose-hulman.edu> References: NNTP-Posting-Host: yerricde.laptop.rose-hulman.edu X-Trace: solomon.cs.rose-hulman.edu 940221468 18815 137.112.205.146 (18 Oct 1999 04:37:48 GMT) X-Complaints-To: news AT cs DOT rose-hulman DOT edu NNTP-Posting-Date: 18 Oct 1999 04:37:48 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MIMEOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Andrew R. Gillett wrote in message news:MPG DOT 1273deccf87c634798b3ff AT news DOT freeserve DOT net... > In comp.os.msdos.djgpp, Snowman 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 . > > Here is a brief outline of what you need to do: > > - Create an interrupt which is called every 60th of a second (or whatever > you want the frame rate to be). Creating an interrupt will use up one of Allegro's interrupt slots. I use one of Allegro's timer handlers whose frequency is 70 Hz. It's called retrace_count > while (not_finished) > { > if (timer_value) > { > // Calculations go here > > if (--timer_value <= 0) > { > timer_value = 0; > > // Draw the graphics here > } > } > } -- Damian Yerrick CM 398, Rose-Hulman Institute of Technology 5500 Wabash Ave Terre Haute, IN 47803 http://come.to/yerrick