1.

Solve : C++ / Real Time User Input?

Answer»

I am creating a C++ console program using (Dev-C++ 4.9.9.2) on a WinXP.
The problem ARISES when I want to get user input.
For the sake of comparison say I MADE a Tetris game.
I mastered the part where I can detect if the arrow keys are pressed.
But what if the user doesn't press anything? I want my program to continue
running regardless of user input and not have to wait for input to move.


if(KEYS_PRESSED){//<----[if nothing is being pressed move on]
//<----[interpret those keystrokes and move accordingly (this part is fine)]
}


MOVE_PIECE();//<----[this will HAPPEN even if user gives no input]



Just trying to AVOID the "Press any key to continue" thing.







Discussion

No Comment Found