Mail Archives: djgpp/1997/07/25/03:47:57
Hi There,
The problem is you are waiting for a key press before the loop will
continue. Try this...
void main(void)
{
init variables;
while(!game_over)
{
printf("whatever");
if(key_pressed())
{
/* find out which key */
if(key(KEY_X))game_over=TRUE;
.
.
etc.
.
} /* End if */
You might need to clear the keyboard buffer before the end of the loop
as if you don't the program will go through the if again. Plus it might
be a good idea to put a rest(); in there otherwise you will get alot of
data flowing onto the screen and scrolling off before you can read it.
Hope I've helped,
Alistair
--
_____________________________________________________________________
Alistair Phillips | Email: a DOT phillips AT student DOT anu DOT edu DOT au
IT Student Consultant, | "I was drunk and, ,_o
Ba/Bsc Undergraduate. | I'm a little hazy." _ \<,_
Australian National University | -Darlingheart ( )/ ( )
_____________________________________________________________________
- Raw text -