Esempio n. 1
0
int main()
{
    //Declare Variables
    char wasd  = ' ';          // Holds player's movement
    char *loc  = 0;            // Holds player location
    char **arrMap1;            // For allocating memory
    int locX   = 0;            // Holds X location
    int locY   = 0;            // Holds Y location
    int turn   = 0;            // Holds turns taken
    int menuIn = 0;            // Holds menu input
    int debug[0];              // Converts char to int for debug file
    bool isGameRunning = true; // Checks if game is still running
    bool action = false;       // Checks if player is fighting

    //Define objects
    Player p;
    Map map1;
    MainMenu menu;

    //Allocate instances
    Speechbox *sB = new Playerbox();
    Playerbox *pB = new Playerbox();
    Pickupbox *pU = new Pickupbox();

    //Build FileStream object
    FileStream f;
    //Display menu and prompt for choice
    f.readFile("Main.mnu", 0, 0);

    cin >> menuIn;

    //If 3, display help screen
    if(menuIn == 3)
    {
        system("cls");
        f.readFile("help.mnu", 0, 0);
        cout << "\nPress Enter to start game\n";
        _getch();
        system("cls");
    }
    //If 4, exit and don,t bother set or output
    else if(menuIn == 4){ cout << "\nGoodbye!\n"; exit(EXIT_SUCCESS); }

    //If not 3, set and output menu
    menu.setInN(menuIn);
    menu.outMenu(menuIn);

    //If load game fail, prompt
    if(menu.getIsCodeGood() == false)
    {
        //Prompt for user info
        cin >> p;

        //Prompt for map properties
        cin >> map1;
    }