Message-ID: <000801be0b29$cb5284a0$7b6195cc@uic> From: "Andrew Deren" To: Subject: Re: loop'ing Date: Sun, 8 Nov 1998 09:09:33 -0600 X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.3110.1 X-Mimeole: Produced By Microsoft MimeOLE V4.72.3110.3 Reply-To: djgpp AT delorie DOT com -----Original Message----- From: Lazer ---¤--- To: djgpp AT delorie DOT com Date: Sunday, November 08, 1998 8:58 AM Subject: loop'ing >I need a function for looping until 'esc' is press'ed! >my code look like this: > >----------------------------------------------- >again: > > /* the game code */ > > if (key[KEY_ESC]) { > return 0; > } > >goto again >----------------------------------------------- > >is there a better way of doing this? > You can just hava a while loop for that: while (1) { if (keypressed()) { // proccess all key events, movement, fireing, etc. also // check for exit thekey = readkey(); if (thekey >> 8 == KEY_ESC) break; } // some other game loop stuff }