Thread: My first C++ game is done!

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #39
    Software Developer jverkoey's Avatar
    Join Date
    Feb 2003
    Location
    New York
    Posts
    1,905
    Originally posted by GrNxxDaY
    none of thta makes much sense to me.
    how can i find out if the user pressed the UP arrow key if it has the same ASCII value as one of the letters?
    the reason it has the same value is because when you do getch(); you have to do it twice, here is the code is used back when I was developing in Dos consoles:

    Code:
    int a=getch();
    cout << a << endl;
    if(a==224)	//224 means the arrow keys and some other stuff
    {
    	int b=getch();
    	cout << b << endl;
    }
    and you can see which key the user pressed that way....k? I didn't do any testing for the keys, because I forgot which key was which, hehe

    hope that helps

    -EDIT-
    lmao, the rest of you guys really know how to confuse a noob, lol
    Last edited by jverkoey; 02-16-2003 at 12:36 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how do the game engine and the api interact?
    By Shadow12345 in forum Game Programming
    Replies: 9
    Last Post: 12-08-2010, 12:08 AM
  2. Open Source / Semi Open source game idea. Help needed
    By CaptainPatent in forum Projects and Job Recruitment
    Replies: 10
    Last Post: 05-16-2007, 10:44 AM
  3. game engine advice?
    By stien in forum Game Programming
    Replies: 0
    Last Post: 01-23-2007, 03:46 PM
  4. My Maze Game --- A Few Questions
    By TechWins in forum Game Programming
    Replies: 18
    Last Post: 04-24-2002, 11:00 PM