Guest User

Untitled

a guest
Jan 23rd, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.24 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <cctype>
  4. #include <string>
  5. #include <sstream>
  6. #include <fstream>
  7. #include <array>
  8. #include "Map.h"
  9. #include "GameObject.h"
  10. #include "Beast.h"
  11. #include "EmptySpace.h"
  12. #include "ImmovableWall.h"
  13. #include "MovableWall.h"
  14. #include "Player.h"
  15.  
  16. using namespace std;
  17.  
  18. int main()
  19. {
  20.     Map gameMap = Map(1);
  21.     gameMap.printMap();
  22.     /*char check = 'a';
  23.     int selection;
  24.     do
  25.     {
  26.         cout << "(1) Start the game" << endl;
  27.         cout << "(2) Load a (different) game" << endl;
  28.         cout << "(3) Generate a random game" << endl;
  29.         cout << "(4) Add a beast" << endl;
  30.         cout << "(5) Move the player" << endl;
  31.         cout << "(6) Change player speed" << endl;
  32.         cout << "(7) Save game" << endl;
  33.         cout << "(8) Quit" << endl;
  34.         cin >> selection;
  35.         if(cin.fail() || (selection != 1 && selection != 2 && selection !=3 && selection != 4 && selection != 5 && selection != 6 && selection != 7 && selection !=8))
  36.         {
  37.             cin.clear();
  38.             cin.ignore(100, '\n');
  39.             cout << "There was an error in your input. Please try again." << endl;
  40.             cout << endl;
  41.         }
  42.         else
  43.         {
  44.             switch(selection)
  45.             {
  46.                 case 1: //Start the game
  47.                 {  
  48.                    
  49.                     for(int i = 0; i < 23; i++)
  50.                     {
  51.                         for(int j = 0; j < 40; i++)
  52.                         {
  53.                             cout << gameMap.grid[i][j].getType();
  54.                         }
  55.                     }
  56.                 }  
  57.                     break;
  58.                 case 2: //Load different game
  59.                     break;
  60.                 case 3: //Generate a random game
  61.                     break;
  62.                 case 4: //Add a beast
  63.                     int x, y;
  64.                     cout << "Enter the x-coordinate: " << endl;
  65.                     cin >> x;
  66.                     if(cin.fail() || x < 0)
  67.                     {
  68.                         cin.clear();
  69.                         cin.ignore(100, '\n');
  70.                         cout << "There was an error in your x input. Please try again." << endl;
  71.                         cout << endl;
  72.                     }
  73.                     cout << "Enter the y-coordinate: " << endl;
  74.                     cin >> y;
  75.                     if(cin.fail() || y < 0)
  76.                     {
  77.                         cin.clear();
  78.                         cin.ignore(100, '\n');
  79.                         cout << "There was an error in your y input. Please try again." << endl;
  80.                         cout << endl;
  81.                     }
  82.                     break;
  83.                 case 5: //Move the player
  84.                     break;
  85.                 case 6: //Change player speed
  86.                     break;
  87.                 case 7: //Save
  88.                     break;
  89.                 case 8: //Quit
  90.                     check = 'q';
  91.                     break;
  92.                
  93.             }
  94.         }
  95.     }while(check != 'q');
  96.     return 0;*/
  97.     system("Pause");
  98. };
Add Comment
Please, Sign In to add comment