I'm trying to make a shooting video game in conole mode but the game pauses to recieve an input from the key board. Ho can I get around this? How do game engines work? DFor exaple in a game like pac-man where the ghosts and other elements in the game work in real-time independently of the player's input, how can I achiev this in console mode?
>So if I don't need to use multithreading how can I get
>around having to wait for an input from the user?
If you need to do something that would be accomplished by multithreading, why do you think you don't need multithreading? You could spawn multiple processes, but I get the feeling you don't "need" that either. This leaves you with polling for input at regular intervals (ala. kbhit) and actually pulling the input with a non-blocking read (ala. getch). But that's some seriously convoluted logic in all but the simplest of cases, and in the end you're essentially simulating threads.
Sorry for the really late reply, but I looked at your suggestion and I was wondering, how would I check to see if an input is available? Please post code. One more thing, is there a way to avail an input to the user for a limited amount of time? One last thing are you familiar with threads?