I am writing a dos-based tetris program in which I need to solve the problem of having the pieces drop while looking for keyboard input form the users. I use the getch() function to get the ASCII values of the arrow keys. My problem is that when I call the getch() command the input stream pauses and waits for keyboard input. I need a function or a different approach that would allow me to look for keyboard input while having the pieces drop at a constant rate. Thanx for any help. Heres a snippet of simplified code.
do
{
command = getch(); // Pauses here
process_command();
//I need soem code to have the piece drop
// while looking for input.
}
while(no_more_moves());
Thanx again,
my email is airdevil23@hotmail.com
Korn
airdevil23@hotmail.com
"procrastination is the key to happiness"
do
{
command = getch(); // Pauses here
process_command();
//I need soem code to have the piece drop
// while looking for input.
}
while(no_more_moves());
Thanx again,
my email is airdevil23@hotmail.com
Korn
airdevil23@hotmail.com
"procrastination is the key to happiness"