From: timg AT climax DOT polaristel DOT net (Tim Gerla) Newsgroups: comp.os.msdos.djgpp Subject: Re: Main Game Loop Date: Thu, 23 Jan 1997 18:40:43 GMT Organization: MEANS Lines: 43 Message-ID: <32e8b01c.7593628@news.polaristel.net> References: <3 DOT 0 DOT 32 DOT 19970119180029 DOT 0073fc64 AT dataplusnet DOT com> Reply-To: timg AT climax DOT polaristel DOT net NNTP-Posting-Host: halstad-87.dialup.means.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp On Wed, 22 Jan 1997 11:13:04 +0000, Moo-Juice wrote: >In article <3 DOT 0 DOT 32 DOT 19970119180029 DOT 0073fc64 AT dataplusnet DOT com>, Michael >Matczynski writes >>Does anyone know of a place on the internet that tells how to structure the main >>game loop of computer game? Like what order the steps should be in (ie. what >>order to get input, draw sprites on the screen, do AI, etc...). Any help is >>appreciated. > >From my experience of game creation, there are many different steps you >could take to accomplish your main game loop, but a standard one I used >to use was > >DO > [Update screen/sprites] > [Handle Control] > [Handle AI] > [Other Stuff] >LOOP > >-- >Moo-Juice Here's the loop I use: While(1) { Erase Sprites Move Sprites/Get keyboard input/etc.... Save Sprite Backgrounds Draw Sprites } It keeps sprites from overwriting each other. :) -Tim -- Tyball AT irc, -====- Greeter Tim Gerla -- timg AT climax DOT polaristel DOT net -- http://timg.home.ml.org/ Unsolicitied e-mail is probihited. Copyright (C) 1996 Tim Gerla Caldera sues Micro$oft, buys DR-DOS and Novell DOS 7, will release OpenDOS, the FREE DOS with multitasking, much more! www.caldera.com