Advertisement

HELP ME PLEASE

Started by November 08, 2000 03:55 PM
1 comment, last by CHollman82 24 years, 2 months ago
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:
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.


sharewaregames.20m.com

Advertisement
Thanks, that does seem more efficient
codeXtremeif(you->intelligence < radish->intelligence) you->STFU();

This topic is closed to new replies.

Advertisement