LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-02-2006, 12:05 PM   #1
toolmania1
LQ Newbie
 
Registered: Jun 2005
Posts: 10

Rep: Reputation: 0
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.
 
Old 01-03-2006, 09:48 PM   #2
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
>> 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..
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
No keyboard input under gnome. gatdrydock Linux - Software 1 07-10-2005 03:15 PM
nonblocking keyboard input? rebelcan Programming 16 10-11-2004 04:22 PM
my mouse input is takes as keyboard input in BASH e1000 Slackware 5 12-08-2003 03:00 PM
Keyboard input not on screen g_rat Programming 1 03-27-2003 11:50 PM
No keyboard input seen neo77777 Linux - General 5 07-12-2002 09:32 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration