Mail Archives: djgpp/1997/01/23/23:34:55
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 -