synchronize keyboard input in Allegro
I have created my first game that simulates the old game Othello. The console version of the game is done. Now, I am trying to add graphics to it. I am using Allegro in Dev C++. I have created my graphics in photoshop and they have been successfully drawn in Allegro. Now, I need to accept keyboard input so that the user can enter the x coordinate, then the y coordinate to place the piece on the 8 x 8 board. However, the loop I am using loops so fast that it is assigning the same value to the x and y even though I am asking for their values separately. I do not know how to slow down the game to accept the x coordinate from the keyboard first, then accept the y coordintate from a different keyboard stroke. There is a rest() function, but that only seems to pause the game, not really what I am looking for.
Any help would be appreciated, even if it just deals with keyboard input in general and not with Allegro.
|