I'm making a videogame, the fact is, that I need something that waits until I press a Character, some kind of multithreading, I don't know. If no character was pressed, then it should continue executing its processes.
Any ideas?
just something like
1 2 3 4
cin.get();
//wait a second
//NO key was pressed?
dosomething();
the time that we have to wait will be the same, even if we press any key
ps. It is really necessary to be a console game, I know, there are libraries like NCurses. :D
Hmmm well, someone that could give me an example for multithreading that calls a thread to wait for some input and after some time has passed, it returns to our main app?
Yes, use SFML's input facilities. When the user presses a key (or moves the mouse or joystick or whatever), the computer makes a log of it and sticks it in an "event queue" that your program should be monitoring. (If you are using SMFL, that is pretty much done for you.)