www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/01/23/23:34:55

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> <LDo+aIAAZf5yEwof AT flag DOT demon DOT co DOT uk>
Reply-To: timg AT climax DOT polaristel DOT net
NNTP-Posting-Host: halstad-87.dialup.means.net
Mime-Version: 1.0
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 <Ben AT flag DOT demon DOT co DOT uk>
wrote:

>In article <3 DOT 0 DOT 32 DOT 19970119180029 DOT 0073fc64 AT dataplusnet DOT com>, Michael
>Matczynski <michaelm AT dataplusnet DOT com> 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, -==<UDIC>==- 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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019