Do this and that, at the same time...
Hi everyone, I wonder if anyone know of a way to do more that one thing at a time, in a c++ console app.
I'm writing something that's supposed to become an ASCII-game some time in the near future. I have no difficulties
with moving a letter around on the screen but since the program is waiting for keyboard input it won't do anything
else at the same time.
Let's say I want to make an ASCII version of pacman, how can I get the "ghosts" moving and at the same time
being able to control pacman ?
Any help or link to a tutorial will be greatly appreaciated.
create a continuous loop that does the stuff you want and then reads the keypress. there's a function in curses that reads the key without pausing, i believe.
Thx for the reply. I forgot to mention that I'm on windows (xp) and that means I don't have curses
Check out http://msdn.microsoft.com/library/de...nckeystate.asp,
remember to include the <windows.h> header if you use that
Thank you! This will surely be of great help.
Excellent console programming tutorial for Windows: