going from &gt;&gt;cin to real time

I have a decent understanding of C++, and have just started working on a console version of galaga (cheesy, yes, but relatively fun and easy) but having to hit enter for anything to happen or even just hitting a key would make it horrible, so i need to do it in real time.

I know (or at least it seems most logical to me) that a game would run in the following manner

initiates game loop
checks for current user input (pressed key/mouse)
responds to user input (if any)
finishes then repeats game loop (except for certain conditions resulting in player death/whatever)

You could have a separate thread for running the game, and gather input etc. from your main thread. As long as you synchronize it so you aren't changing anything when one thread expects it to be steady, you should be fine. (for threading, look at pthreads)

ok, threads are way above my head, apparently im not quite as decent as i thought/you are assuming

Code:

void Player1Move(char array[75][31]){
int input;

if(kbhit()){
input=getch();

there is a snippet of coding for one of my friends console version of pong, in order for it to work in real time he used kbhit() and getch() together, unfortunately i have not found an equivalent of that combo for mac (nor can i even get getch() to work decently...)

i am looking for something like that that is simple, however if you think that this is a stupid solution and/or leading me to horrible coding habits or something of that like please suggest something more appropriate

ok, i looked at the man pages for the functions within curses.h, it looks like to me that i will have to use half-delay mode (or it at least seems logical at this point), so if i call halfdelay with halfdelay(1); it should be set to 1/10 of a second, then every time getch is called it will wait 1/10th of a second before moving on

Quote: To initialize the routines, the routine initscr or newterm must be
called before any of the other routines that deal with windows and
screens are used. The routine endwin must be called before exiting.
To get character-at-a-time input without echoing ...