??check for input??

Hi. Made myself a game that works nice except 1 thing. I want my program to check for input and if input is made the program skips into an if statement. but if input isn't made the program skips into an else if statement.
with cin the program stops and wait until input is made which is not what i want.
I'm using .NET enviroment
Last edited on
I am not aware of any type of input mechanism with a timed wait. Sounds like you need to research multithreading. You need to launch a worker thread that can wait on input while another thread continues to run. If input is received the worker thread can signal some other object that something was received. Or the other thread can simply check periodically to determine if input was received and execute the if..else statement. That could be tricky for a beginner but if that is what you need then the only solution I can think of is adding a new thread to your program. Good luck! If you post more details about your game perhaps others might suggest some alternative solutions. I assume this is a console application. Is that correct?
That is correct. ugh, sounds like I need some more studdy. where could I read about that?
don't really know if any code will help but my game is that you have two players that can move in a 2*8 enviroment. then from above a bomb will fall down and you must push yous opponent into the bomd to win. well the thing is I want the bomb to fall down even if no input is made.
guess you could solve this smarter but I have that FORM1 recieves input and sends that to my game engine.
Topic archived. No new replies allowed.