Thread: text rpg

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    224
    Code:
    ...
    int board[5][5] = {
             0,0,0,0,0,
             0,0,0,0,0,
             0,0,0,0,0,
             0,0,0,0,0,
             0,0,0,0,0,};
    char choice;
    int player[x][y];
    char Player = 1;
    
    void PlayerMove()
    {
           cin<<choice;
           choice=tolower(getch());
           switch(choice)
           case 'y':
                x++;
                break;
           case 'h':
                x--;
                break;
            case 'j':
                y--;
                break;
            case 'g':
                 y++;
                 break;
            system("cls");
            Board();
    }
    ...
    void Board()
    {
           playermove();
           board[x][y]=player;
           for(int i = 0; i <= 5; i++)
               for(int j = 0; j<= 5; j++)
                        cout<<" ";
    }
    is this any better??

    im more conserned about displaying the map and the player than anything else because switch statements arent that hard to figure out. so does the "void Board();" work or do i still need to change one or two things?
    Last edited by c++.prog.newbie; 12-21-2001 at 04:20 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. text rpg help
    By xxwerdxx in forum Game Programming
    Replies: 1
    Last Post: 11-26-2005, 08:16 PM
  2. Replies: 3
    Last Post: 05-25-2005, 01:50 PM
  3. struct question
    By caduardo21 in forum Windows Programming
    Replies: 5
    Last Post: 01-31-2005, 04:49 PM
  4. mygets
    By Dave_Sinkula in forum C Programming
    Replies: 6
    Last Post: 03-23-2003, 07:23 PM
  5. Check out My Text Rpg Game
    By knight543 in forum C++ Programming
    Replies: 3
    Last Post: 05-17-2002, 10:40 PM