Guest User

Untitled

a guest
Apr 24th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 19.15 KB | None | 0 0
  1. //Program Updates/Fixes
  2.  
  3. //Sep 18, 2007. Total wipe of file. Making second version prototype, which
  4. //includes an expanded map array type (struct data types), improved funcionality
  5. //which includes player movement (and yes a player object, and possibly other
  6. //fixes.
  7. #include <iostream>
  8. #include <ctime>
  9. #include <cmath>
  10. #include <stack>
  11. #include <limits>
  12. #include <stdlib.h>
  13. #include <curses.h>
  14. #include "uniform.h"
  15. #include "uniform.cpp"
  16.  
  17. #include "PlayerObject.cpp"
  18.  
  19. //Amount of rooms in map
  20. #define ROOMLOWERLIMIT 5
  21. #define ROOMUPPERLIMIT 10
  22. //Array "Map Attributes"
  23. #define XLENGTH 40
  24. #define YLENGTH 80
  25.  
  26. struct MapArrayType
  27. {
  28.     bool        AreaAccess;
  29. };
  30.  
  31. class MapType
  32. {
  33.     public:
  34.  
  35. //defualt constructor  
  36. MapType();
  37. //destructor
  38. ~MapType();
  39. //Post-Condition...Room is created
  40. void    CreateRoom(int,int);
  41. //Post-Condition...Random Number is generated and returned as
  42. //value of function
  43. int     RandomNumberGenerator(int, int);
  44. //Post-Condition...True or False returned as result
  45. bool    CanRoomBeCreated(int, int);
  46. //Post-Condition...Cordinates for the new room are plotted
  47. void    FindNextRoom(int &, int &);
  48. //Post-Condition...A new path within bounds is created
  49. void         CreatePath(int, int);
  50. //Post-Condition...Prints Out MapArrayType
  51. void      PrintMap();
  52.  
  53. //Post - Condition...User input is captured and sent to validation function
  54. //UserInput Is created, and the user input is stored
  55. void    CaptureInput();
  56.  
  57. //Change as of Sep 18
  58. //Pre-Condition...Capture Input was called and has altered the data member
  59. //User Input
  60. //Post-Condition...True/False value is returned to determine if the user
  61. //Is able to move to selected spot.
  62. bool    IsInputValid(char);
  63.  
  64. //Change as of Sep 18
  65. //Pre-Condition...function IsInputValid has been called and returned a true/false
  66. //value
  67. //Post-Condition...either the user moves from one cell to the other, or not and
  68. //an error message is displayed.
  69. void    ProcessInput(char);
  70.  
  71.  
  72. private:
  73.  
  74. int TotalNumberOfRooms;
  75. int RoomLength;
  76. int RoomWidth;
  77. int RoomCounter;
  78.  
  79. //Stacks to hold old map movements
  80. stack<int> StackX;
  81. stack<int> StackY;
  82.  
  83. //User Related Variables
  84. //Change as of Sep 18
  85. int UserCurrentXPos;
  86. int UserCurrentYPos;
  87.  
  88.  
  89. //NEW map Array, based on struct. This "holds" the entire contents of the map.
  90. MapArrayType MapArray[XLENGTH][YLENGTH];
  91. };
  92.  
  93. //client program
  94. int main()
  95. {
  96.     //Declare local variables
  97. MapType MapGenerator;
  98.  
  99. char done = 'n';
  100. int  testvar = 1;  
  101. MapGenerator.CreateRoom(0,0);
  102. MapGenerator.PrintMap();
  103.    
  104. while (done == 'n')
  105. {
  106.     if (testvar / 100000 == 1)
  107.         {
  108.             clear();           
  109.             addstr("Would You Like to Quit Now? ");
  110.             addch('\n');
  111.             addch('\r');
  112.             addstr("Press any but n to quit!");
  113.             refresh();
  114.             //Allow continous input!
  115.             cbreak();
  116.             done = getch();        
  117.         }
  118. MapGenerator.CaptureInput();
  119. testvar++;
  120. }
  121. //Turn off terminal color
  122. attroff(COLOR_PAIR(1));
  123. //Refresh output to standard screen!
  124. refresh();
  125. //pause the fing screen!!!
  126. //getch();
  127. //MAY HAVE TO REMOVE THIS LINE!!!
  128. //KILL CURSES TERMINAL MANIUPULATION!
  129. endwin();
  130. return 0;
  131. }
  132.  
  133. /**************************************************
  134. UPDATE 11/16/2011
  135. MapType::MapType defualt constructor
  136.  
  137. Changes:
  138.  
  139. 1) Put all constants as define macros
  140. ***************************************************/
  141.  
  142.  
  143. //defualt Constructor
  144. MapType::MapType()
  145. {
  146.  
  147.  
  148.  
  149. //Set all cells in map to walls
  150. for (int counterx = 0; counterx < XLENGTH; counterx++){
  151.     for (int countery = 0; countery < YLENGTH; countery++)
  152.         {
  153.     MapArray[counterx][countery].AreaAccess = 0;
  154.         }
  155.     }
  156. }
  157.  
  158. MapType::~MapType()
  159. {
  160. //Uh...well there aren't any pointers...
  161. }
  162.  
  163. //RandomNumberGenerator!
  164. int MapType::RandomNumberGenerator(int LowNumber, int HighNumber)
  165. {
  166. //Reseed Random Number Generator
  167. IntitializeSeed();
  168. return Uniform(LowNumber,HighNumber);
  169. }
  170.  
  171. /**************************************************
  172. UPDATE 11/16/2011
  173. MapType::CanRoomBeCreated
  174.  
  175. Changes:
  176.  
  177. 1) Put all constants as define macros
  178. ***************************************************/
  179.  
  180.  
  181. bool MapType::CanRoomBeCreated(int XCoord, int YCoord)
  182. {
  183. //determine if room exceeds the x and y chords of the room
  184. if ((RoomWidth + XCoord > XLENGTH) || (RoomLength + YCoord > YLENGTH))
  185.     {
  186.         return false;
  187.     }
  188. //Determine if this room will colide with another and return false if it does!
  189. else if (RoomWidth >= RoomLength)
  190.     {
  191.      cout << "crash 1" << endl;
  192.                                              for (int i = XCoord,countx = 0;countx < RoomWidth;i++,countx++){
  193.                                              for (int j = YCoord,county = 0; county < RoomLength; j++,county++){
  194.                                              if (MapArray[i][j].AreaAccess == 1){
  195.                                              return false;
  196.                                              }}}
  197.     }
  198. else if (RoomWidth < RoomLength)
  199.     {
  200.      cout << "crash 2" << endl;
  201.                                              for (int  j = YCoord,county = 0;county < RoomLength;j++,county++){
  202.                                              for (int i = XCoord,countx = 0; countx < RoomWidth; i++,countx++){
  203.                                              if (MapArray[i][j].AreaAccess == 1){
  204.                                              return false;
  205.                                              }}}
  206.     }
  207. return true;
  208.  
  209. }
  210. /**************************************************
  211. UPDATE 11/16/2011
  212. MapType::`
  213.  
  214. Changes:
  215.  
  216. 1) Put all constants as define macros
  217. ***************************************************/
  218.  
  219.  
  220. void MapType::CreateRoom(int XCoord, int YCoord)
  221. {
  222.      int OldXCoord;
  223.      int OldYCoord;
  224.      //Find Total Number of rooms
  225.      TotalNumberOfRooms = RandomNumberGenerator(ROOMLOWERLIMIT,ROOMUPPERLIMIT);
  226.    
  227.     while (TotalNumberOfRooms != RoomCounter){
  228.  
  229.           //Get new chords for new rooms
  230.           RoomLength = RandomNumberGenerator(ROOMLOWERLIMIT,ROOMUPPERLIMIT);
  231.           RoomWidth = RandomNumberGenerator(ROOMLOWERLIMIT,ROOMUPPERLIMIT);
  232.          
  233.  
  234.           FindNextRoom(XCoord,YCoord);
  235.  
  236.          
  237.           if ((RoomCounter >= 1) && (CanRoomBeCreated(XCoord,YCoord) == true)){
  238.                cout << "MORE THAN ONE ROOM CREATED! " << endl;
  239.                //Create new rooms
  240.  
  241.           //push new chrds of room onto stacktype
  242.                StackX.push(XCoord);
  243.                StackY.push(YCoord);
  244.                //Make Room
  245.    
  246.                for (int i = 0; i < RoomWidth; i++){
  247.                     for (int j = 0; j < RoomLength; j++){
  248.                          MapArray[XCoord+i][YCoord+j].AreaAccess = 1;
  249.                                             }
  250.                                         }
  251.                                                  
  252.                                    PrintMap();
  253.                                      //Clean the stream and ask for input
  254.                                    cin.ignore().get();
  255.                RoomCounter++;
  256.                cout << "create path func called " << endl;
  257.                CreatePath(XCoord,YCoord);
  258.                 PrintMap();
  259.                                      //Clean the stream and ask for input
  260.                                    cin.ignore().get();
  261.     }
  262.    
  263.     else if ( (RoomCounter < 1) && (CanRoomBeCreated(XCoord,YCoord) == true)){
  264.         //push Start of room onto stack
  265.         StackX.push(XCoord);
  266.          StackY.push(YCoord);
  267.         //Update as of Sep 18
  268.         //Log Players position on map and set starting point
  269.         UserCurrentXPos = XCoord;
  270.         UserCurrentYPos = YCoord;
  271.                
  272.           //Make Room                                                                    
  273.           for (int i = 0;i < RoomWidth;i++){
  274.                for (int j = 0; j < RoomLength; j++){
  275.                     MapArray[XCoord+i][YCoord+j].AreaAccess = 1;
  276.                     }
  277.                }
  278.                
  279.            //Place Player On Map Object
  280.          
  281.                    
  282.         MapArray[XCoord][YCoord].AreaAccess = 2;
  283.    
  284.  
  285.           PrintMap();
  286.  
  287.            cout << "Player placed on map!" << endl;
  288.           //Clean the stream and ask for input
  289.           cin.ignore().get();
  290.           //Incrament Room Counter
  291.           RoomCounter++;
  292.           }
  293.      }
  294.     return;
  295. }
  296. //Room Finder Function
  297. void MapType::FindNextRoom(int &XCoord, int &YCoord)
  298. {
  299. //Get Randomly generated chords for next room though Random Number Gen Function
  300. XCoord = RandomNumberGenerator(0,XLENGTH);
  301. YCoord = RandomNumberGenerator(0,YLENGTH);
  302.  
  303. //Randomize if the cords are the same
  304. while(XCoord == YCoord)
  305. YCoord = RandomNumberGenerator(0,80);
  306.  
  307. return;
  308. }
  309.  
  310. //Function to draw pathlines between rooms
  311. void MapType::CreatePath(int XCoord, int YCoord)
  312. {
  313. int oldXCoord = StackX.top();
  314. int oldYCoord = StackY.top();
  315.    
  316. cout << "XCoord = " << XCoord << endl;
  317. cout << "YCoord = " << YCoord << endl;
  318. cout << "oldXCoord = " << oldXCoord << endl;
  319. cout << "oldYCoord = " << oldYCoord << endl;
  320.  
  321.  
  322.  
  323. if ((XCoord == oldXCoord) && (YCoord == oldYCoord))
  324. {
  325.   return;
  326. }
  327. //both NEW x and y chords are greater than old ones
  328. else if ((XCoord >= oldXCoord) && (YCoord >= oldYCoord))
  329. {
  330.           cout << "both NEW x and y chords are greater than old ones" << endl;
  331.          
  332.           //Clean the stream and ask for input
  333.                                    cin.ignore().get();
  334.                                    PrintMap();
  335.                                    
  336.     for (; XCoord > oldXCoord; XCoord--){
  337.           if (MapArray[XCoord][YCoord].AreaAccess != 2)
  338.                MapArray[XCoord][YCoord].AreaAccess = 1;
  339.     }
  340.     for (; YCoord > oldYCoord; YCoord--){
  341.           if (MapArray[XCoord][YCoord].AreaAccess != 2)
  342.                MapArray[XCoord][YCoord].AreaAccess = 1;
  343.     }
  344. }
  345. //both NEW x and y chords are less or equal to then old ones
  346. else if ((XCoord <= oldXCoord) && (YCoord <= oldYCoord))
  347. {
  348.          
  349.           cout << "both NEW x and y chords are less or equal to then old ones" << endl;
  350.          
  351.                //Clean the stream and ask for input
  352.                                    cin.ignore().get();
  353.                                    PrintMap();
  354.                                    
  355.     for (; XCoord < oldXCoord; XCoord++){
  356.           if (MapArray[XCoord][YCoord].AreaAccess != 2)
  357.                MapArray[XCoord][YCoord].AreaAccess = 1;
  358.     }
  359.     for (; YCoord < oldYCoord; YCoord++){
  360.           if (MapArray[XCoord][YCoord].AreaAccess != 2)
  361.                MapArray[XCoord][YCoord].AreaAccess = 1;
  362.     }
  363. }
  364.  
  365. //new and old XCoords are the same, new Y chords are greater or equal to old Y
  366. else if ((XCoord == oldXCoord) && (YCoord >= oldYCoord)){
  367.           cout << "new and old XCoords are the same, new Y chords are greater or equal to old Y " << endl;
  368.           //Clean the stream and ask for input
  369.                                    cin.ignore().get();
  370.                                    PrintMap();
  371.                                    
  372.     for (; YCoord > oldYCoord; YCoord--)
  373.           if (MapArray[XCoord][YCoord].AreaAccess != 2)
  374.                MapArray[XCoord][YCoord].AreaAccess = 1;
  375. }
  376. //XCoords both the same, New Y chord is less than old one  
  377. else if ((XCoord == oldXCoord) && (YCoord < oldYCoord)){
  378.           cout << "XCoords both the same, New Y chord is less than old one" << endl;
  379.           //Clean the stream and ask for input
  380.                                    cin.ignore().get();
  381.                                    PrintMap();
  382.                                    
  383.     for (; YCoord < oldYCoord; YCoord++)
  384.           if (MapArray[XCoord][YCoord].AreaAccess != 2)
  385.                MapArray[XCoord][YCoord].AreaAccess = 1;
  386. }
  387. //Y chords both the same, Old X greater or equal to new one
  388. else if ((oldYCoord == YCoord) && (XCoord >= oldXCoord))
  389. {
  390.           cout << "Y chords both the same, Old X greater or equal to new one" << endl;
  391.           //Clean the stream and ask for input
  392.                                    cin.ignore().get();
  393.                                    PrintMap();
  394.                                    
  395.      for (; XCoord > oldXCoord; XCoord++)
  396.           if (MapArray[XCoord][YCoord].AreaAccess != 2)
  397.                MapArray[XCoord][YCoord].AreaAccess = 1;
  398. }
  399. //YCoords both the same, New X chord is less than old one
  400. else if ((YCoord == oldYCoord) && (XCoord < oldXCoord))
  401. {
  402.  
  403.  
  404.           cout << "YCoords both the same, New X chord is less than old one" << endl;
  405.           //Clean the stream and ask for input
  406.                                    cin.ignore().get();
  407.                                    PrintMap();
  408.                                    
  409.     for (; XCoord < oldXCoord; XCoord++)
  410.           if (MapArray[XCoord][YCoord].AreaAccess != 2)
  411.                MapArray[XCoord][YCoord].AreaAccess = 1;
  412. }
  413. //if newX is less than old X, new Y greater than old y
  414. else if ((XCoord <= oldXCoord) && (YCoord >= oldYCoord))
  415. {
  416.           cout << "if newX is less than old X, new Y greater than old y" << endl;
  417.           //Clean the stream and ask for input
  418.                                    cin.ignore().get();
  419.                                    PrintMap();
  420.                                    
  421.      for (; XCoord < oldXCoord; XCoord++)
  422.         {
  423.           if (MapArray[XCoord][YCoord].AreaAccess != 2)
  424.                MapArray[XCoord][YCoord].AreaAccess = 1;
  425.         }
  426.   for (; YCoord > oldYCoord; YCoord--)
  427.         {
  428.           if (MapArray[XCoord][YCoord].AreaAccess != 2)
  429.                MapArray[XCoord][YCoord].AreaAccess = 1;
  430.         }
  431. }
  432. //if newX is greater than than old X, new Y less than than old y
  433. else if ((XCoord > oldXCoord) && (YCoord < oldYCoord))
  434. {
  435.      cout << "if newX is greater than than old X, new Y less than than old y" << endl;
  436.      //Clean the stream and ask for input
  437.                                    cin.ignore().get();
  438.                                    PrintMap();
  439.                                    
  440. for (XCoord; XCoord > oldXCoord; XCoord--)
  441.     {
  442.      if (MapArray[XCoord][YCoord].AreaAccess != 2)
  443.           MapArray[XCoord][YCoord].AreaAccess = 1;
  444.     }
  445. for (YCoord; YCoord < oldYCoord; YCoord++)
  446.     {
  447.      if (MapArray[XCoord][YCoord].AreaAccess != 2)
  448.           MapArray[XCoord][YCoord].AreaAccess = 1;
  449.     }  
  450. }
  451. }
  452. //PrintMap Function
  453. void MapType::PrintMap()
  454. {
  455. //Clear screen
  456. //Keep in mind that curses seems to have a problem with
  457. //Refreshing the terminal screen if we do not send a clear
  458. //macro to the screen buffer.
  459. clear();
  460. //Prepare Terminal for manipulation
  461. initscr();
  462.    
  463. //Check to see if terminal supports color
  464. if(has_colors() == false)
  465.     {
  466.         endwin();
  467.         printf("Your terminal does not support color \n");
  468.         exit(1);
  469.     }
  470. else
  471.     start_color();
  472.  
  473. //Select pairs of colors, forground and background
  474. init_pair(1, COLOR_WHITE, COLOR_BLACK);
  475. //Apply Color Set
  476. attron(COLOR_PAIR(1));
  477.  
  478. //Print out entire map
  479. for (int counterx = 0; counterx < 40; counterx++)
  480.     {
  481.         for (int countery = 0; countery < 80; countery++)
  482.         {
  483.             //IF PLAYER IS ON SPOT!
  484.             if (MapArray[counterx][countery].AreaAccess == 2)
  485.                 //Display Player Icon
  486.                 addch('@');
  487.             //If cell is WALL
  488.             else if (MapArray[counterx][countery].AreaAccess == 0)
  489.                 addch('#');
  490.             //If Spot Is Open for movement (nothing there)
  491.             else if (MapArray[counterx][countery].AreaAccess == 1)
  492.                 //Display Open Cell Icon
  493.                 addch('.');
  494.         }
  495.         //Knock logical Cursor down to a new line
  496.         addch('\n');
  497.         //Return logical cursor back to left of screen
  498.         addch('\r');
  499.     }
  500. //Turn off terminal color
  501. //attroff(COLOR_PAIR(1));
  502.  
  503. //Refresh output to standard screen!
  504. refresh();
  505.  
  506. //pause the fing screen!!!
  507. //getch();
  508. //MAY HAVE TO REMOVE THIS LINE!!!
  509. //KILL CURSES TERMINAL MANIUPULATION!
  510. //endwin();
  511. }
  512. void MapType::CaptureInput()
  513. {
  514. //Declare Variable
  515. char UserInput = ' ';
  516. //Allow Continious Input
  517. cbreak();
  518. //Stop Character Echo
  519. noecho();
  520.  
  521. //Get User Input Key
  522. UserInput = getch();
  523. //Find out if function is valid.
  524. while (IsInputValid(UserInput) == false ){
  525. clear();
  526. addstr("\nInput is Invalid. Please try again\n");
  527. addstr("\nPress a Key to continue\n");
  528. PrintMap();
  529. UserInput = getch();
  530. }
  531. //Preform Movement
  532. ProcessInput(UserInput);
  533. }
  534.  
  535. bool MapType::IsInputValid(char UserInput)
  536. {
  537. //If User tries to move to the lower left
  538. if (UserInput == '1')
  539. {
  540.     if (MapArray[UserCurrentXPos+1][UserCurrentYPos-1].AreaAccess == 0)
  541.         return false;
  542.     else
  543.     return true;
  544. }
  545. //If User Tries to move down
  546. else if (UserInput == '2')
  547. {
  548.      if (MapArray[UserCurrentXPos+1][UserCurrentYPos].AreaAccess == 0)
  549.     return false;
  550.      else
  551.     return true;
  552. }
  553. //If user Tries to move to lower right
  554. else if (UserInput == '3')
  555. {
  556.     if (MapArray[UserCurrentXPos+1][UserCurrentYPos+1].AreaAccess == 0)
  557.     return false;
  558.     else
  559.     return true;
  560. }
  561. //If user Tries to move to left
  562. else if (UserInput == '4')
  563. {
  564.     if (MapArray[UserCurrentXPos][UserCurrentYPos-1].AreaAccess == 0)
  565.         return false;
  566.     else
  567.         return true;
  568. }
  569. //If user tries to move right
  570. else if (UserInput == '6')
  571. {
  572.     if (MapArray[UserCurrentXPos][UserCurrentYPos+1].AreaAccess == 0)
  573.         return false;
  574.     else
  575.         return true;
  576. }
  577. //If user tries to move to upper left
  578. else if (UserInput == '7')
  579. {
  580.     if (MapArray[UserCurrentXPos-1][UserCurrentYPos-1].AreaAccess == 0)
  581.         return false;
  582.     else
  583.         return true;
  584. }
  585. //If User tries to move up
  586. else if (UserInput == '8')
  587. {
  588.     if (MapArray[UserCurrentXPos-1][UserCurrentYPos].AreaAccess == 0)
  589.         return false;
  590.     else
  591.         return true;
  592. }
  593. //If User tries to move upper left
  594. else if (UserInput == '9')
  595. {
  596.     if (MapArray[UserCurrentXPos-1][UserCurrentYPos+1].AreaAccess == 0)
  597.         return false;
  598.     else
  599.         return true;
  600. }
  601. //Movement is invalid!!
  602. return false;
  603. }
  604. //If User tries to move upper right
  605. void MapType::ProcessInput(char UserInput)
  606. {
  607. //If user tries to move to lower left
  608. if (UserInput == '1'){
  609. MapArray[UserCurrentXPos+1][UserCurrentYPos-1].AreaAccess = 2;
  610. MapArray[UserCurrentXPos][UserCurrentYPos].AreaAccess = 1;
  611. UserCurrentXPos = UserCurrentXPos++;
  612. UserCurrentYPos = UserCurrentYPos--;   
  613. }      
  614. //If User Tries to move down
  615. else if (UserInput == '2')
  616. {
  617. MapArray[UserCurrentXPos+1][UserCurrentYPos].AreaAccess = 2;
  618. MapArray[UserCurrentXPos][UserCurrentYPos].AreaAccess = 1;
  619. UserCurrentXPos = UserCurrentXPos++;
  620. }
  621.  
  622. //If User tries to move to the lower right
  623. else if (UserInput == '3')
  624. {
  625. MapArray[UserCurrentXPos+1][UserCurrentYPos+1].AreaAccess = 2;
  626. MapArray[UserCurrentXPos][UserCurrentYPos].AreaAccess = 1;
  627. UserCurrentXPos = UserCurrentXPos++;
  628. UserCurrentYPos = UserCurrentYPos++;
  629. }
  630. //If user tries to move left
  631. else if (UserInput == '4'){
  632. MapArray[UserCurrentXPos][UserCurrentYPos-1].AreaAccess = 2;
  633. MapArray[UserCurrentXPos][UserCurrentYPos].AreaAccess = 1;
  634. UserCurrentYPos = UserCurrentYPos--;
  635. }
  636. //If user tries to move right
  637. else if (UserInput == '6')
  638. {
  639. MapArray[UserCurrentXPos][UserCurrentYPos+1].AreaAccess = 2;
  640. MapArray[UserCurrentXPos][UserCurrentYPos].AreaAccess = 1;
  641. UserCurrentYPos = UserCurrentYPos++;
  642. }
  643. //If user tries to move upper left
  644. else if (UserInput == '7')
  645. {
  646. MapArray[UserCurrentXPos-1][UserCurrentYPos-1].AreaAccess = 2;
  647. MapArray[UserCurrentXPos][UserCurrentYPos].AreaAccess = 1;
  648. UserCurrentXPos = UserCurrentXPos--;
  649. UserCurrentYPos = UserCurrentYPos--;
  650. }
  651. //If user tries to move up
  652. else if (UserInput == '8')
  653. {
  654. MapArray[UserCurrentXPos-1][UserCurrentYPos].AreaAccess = 2;
  655. MapArray[UserCurrentXPos][UserCurrentYPos].AreaAccess = 1;
  656. UserCurrentXPos = UserCurrentXPos--;   
  657. }
  658. //If user tries to move upper right
  659. else if (UserInput == '9')
  660. {
  661. MapArray[UserCurrentXPos-1][UserCurrentYPos+1].AreaAccess = 2;
  662. MapArray[UserCurrentXPos][UserCurrentYPos].AreaAccess = 1;
  663. UserCurrentXPos = UserCurrentXPos--;
  664. UserCurrentYPos = UserCurrentYPos++;   
  665. }
  666. PrintMap();
  667. }
Add Comment
Please, Sign In to add comment