I am trying to get a keyboard input, but if it doesn't happen in about half a second I want it to continue to the rest of the loop. I tried using kbhit(); but it won't wait for the input, it just loops with out stopping. This is the loop in question:
while(flags)
{
gameing.updateDraw(0, 0);
keyIn = getch();
//Sleep(20);
switch(keyIn)
{
case UP_ARROW:
flags = gameing.updateDraw(-1, 1);
break;
case DOWN_ARROW:
flags = gameing.updateDraw(1, 1);
break;
case WKEY:
flags = gameing.updateDraw(-1, 2);
break;
case SKEY:
flags = gameing.updateDraw(1, 2);
break;
}
All help will be greatly appreciated. I am trying to avoid using alarm();