Re: [Dev-C++] Help with Game Problem
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Brian S. <blu...@at...> - 2003-03-12 00:47:18
|
Oh yes, forgot to mention that I am using the Allegro library. Ill try the method that you gave me and see if that gets me anywhere. -Brian ----- Original Message ----- From: "Robson Bernard" <rob...@su...> To: "Brian Savells" <blu...@at...> Sent: Tuesday, March 11, 2003 6:43 PM Subject: Re: [Dev-C++] Help with Game Problem > Have you tried allegro game library (compatible with Dev-C++)? With allegro > you have some great stuff to make games. Try www.talula.demon.co.uk and > click the link to allegro library. > > Below a brief example of how to set interrupt handlers to manage game timing > with allegro and c++. It makes a very stable timing: > > Hope it helps! > > > // this boolean variable prevents from jumping for the next game step before > the time expected; > volatile bool doInterrupt; > > > > void refresh() > { > doInterrupt = false; > } > END_OF_FUNCTION(refresh) > > > > void doGame() > { > do { > doInterrupt = true; //sets another step > > //game stuff > > while(doInterrupt); //while doInterrup is true, the game does > not advance for the next step. > //this interval is set by the > argument in the Install_Int funtion (in miliseconds). > > } while(!key[KEY_ESC]); > > } > > > > // this function sets an interrupt handler calling function 'refresh()' > every 50ms. > Install_int(refresh, 50); > |