LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   synchronize keyboard input in Allegro (https://www.linuxquestions.org/questions/programming-9/synchronize-keyboard-input-in-allegro-398660/)

toolmania1 01-02-2006 12:05 PM

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.

xhi 01-03-2006 09:48 PM

>> 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.

this does not sound right.. at all. if you post the code it may be easier to diagnose the problem..

a loop does not just loop out of control if you are using everything right..


All times are GMT -5. The time now is 03:19 AM.