Originally posted by revelation437
one more question
since this is a loop, it wont actually check the timer until it ends the loop
the problem with tha is taht, if someone waits in game for input, the timer will never be checked, thus giving him unlimited time
any way around this?
You'd have to write your own input function. This can be done using kbhit() and getch(), though you'll need conio.h which isn't a standard header.
Code:
DWORD StartTime = GetTickCount()
DWORD TimeFrame = 1000 * 60;
while((GetTickCount() - StartTime) < TimeFrame)
{
if(kbhit())
{
Key = getch();
AddCharacterToInputBuffer(Key);
}
}