Advertisement

Checking user input...

Started by May 22, 2002 07:57 PM
1 comment, last by Ragadast 22 years, 7 months ago
I'm making a text RPG using BC++ under DOS (win 98). Is there a way to get the user input (the player actions in the game) without using cin? I need to know this so I can check the NPC's movement in my main loop. Something like this:

int main()
{
    while(bPlaying)
    {
         ....
         ....
         checkuserinput();
         checknpcmovement();
         ....
         ....
    }
}
 
If I use cin, It would just check the NPC's movement after the player writes a command and hits enter, and that's not the idea. My point is to let NPC's move freely through the world without waiting for the player's input. [edited by - Ragadast on May 22, 2002 9:00:00 PM]
kbhit() ?
Hello from my world
Advertisement
Check out this site.
Game Tutorials.com

They have a list of console funstions that you can use to make stuff using ASCII charaters in the console, and they also deal with topics such as the game loop, and receiving input from the keyboard and mouse. Or you can check out the the MSDN and do a search for ReadConsoleInput().

_____________________________
If power corrupts,
and absolute power corrupts absolutly,
Then, being a programmer with absolute power over my games,
does this mean i am absolutly corrupted?
Absolutly.


[edited by - Mrbeaner on May 23, 2002 1:12:13 PM]
------------------------------------------VOTE Patrick O'GradyWrite in Presidential CandidateThe Candidate who Cares.

This topic is closed to new replies.

Advertisement