HELP ME PLEASE
Can someone tell me how they handle user input in C++(dos). The way I do it goes something like this:
int key;
START:
while(!kbhit())
{
//main game loop
}
key=getch();
if(key==whatever)do something
.
.
.
goto START;
I don''t like it very much because it depends on the key repeat rate on the computer so I was wondering how everyone else does it
thanx.
codeXtremeif(you->intelligence < radish->intelligence) you->STFU();
I would do it like this:
Please state the nature of the debugging emergency.
while(1){ if(!kbhit()) { switch(getch()) { // put all the key cases in here } } // do all the processing here}
Please state the nature of the debugging emergency.
Thanks, that does seem more efficient
codeXtremeif(you->intelligence < radish->intelligence) you->STFU();
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement