Thread: console based moving

  1. #1
    Sir Mister Insane Sako Klinerr1's Avatar
    Join Date
    May 2002
    Posts
    608

    console based moving

    i am an expieranced flash coder. and i have also seen some rpgs made in MSVC++ that the user presses an arror key to chance the x/y position of sosomething, is this possible in like a console based program?
    Email: [email protected] || AIM: MisterSako || MSN: [email protected]

    -the shroom has spoken

  2. #2
    Registered User
    Join Date
    May 2002
    Posts
    317
    yes, this is where a loop with kbhit() comes into play,

    int keypress;

    while(1){
    if(kbhit){
    keypress = getch();
    switch(keypress){
    case //ect.
    }
    //rest of game code for enemies and stuff
    }

    I'm attaching a header file that defines all the keys for you:

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Game console input
    By glUser3f in forum Game Programming
    Replies: 3
    Last Post: 11-07-2003, 04:33 AM
  2. Linux console window questions
    By GaPe in forum Linux Programming
    Replies: 1
    Last Post: 12-28-2002, 12:18 PM
  3. Sprites In Console
    By c++_n00b in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 04-13-2002, 07:02 AM
  4. win32 apps compiled with GCC start console window!
    By Citrus538 in forum Windows Programming
    Replies: 5
    Last Post: 02-18-2002, 10:35 PM
  5. Just one Question?
    By Irish-Slasher in forum C++ Programming
    Replies: 6
    Last Post: 02-12-2002, 10:19 AM