Ejemplo n.º 1
0
        /// <summary>Creates the second room</summary>
        /// <param name="h">The user's character</param>
        private void MakeRoomTwo(Human h)
        {
            _roomTwoWalls = RoomTwo.MakeRoomTwo(h, _height, _width, _locations,
                                                _roomTwoWalls, _fileName);
            _fileName = "RoomTwoMap.txt";
            //sets user's location
            _userLocation = new Point(1, 0);

            _height    = 5;
            _width     = 20;
            _locations = SetUpLocations(_locations);

            SetInaccessibleWalls(_roomTwoWalls);

            //set enemy spawns
            _locations[2, 1]  = new Enemy(Globals.UserLevel, new Point(2, 1), "Sergeant");
            _locations[5, 1]  = new Enemy(Globals.UserLevel, new Point(5, 1));
            _locations[11, 1] = new Enemy(Globals.UserLevel, new Point(11, 1));
            _locations[12, 1] = new Enemy(Globals.UserLevel, new Point(12, 1));
            _locations[13, 1] = new Enemy(Globals.UserLevel, new Point(13, 1));
            _locations[12, 2] = new Enemy(Globals.UserLevel, new Point(12, 2));
            _locations[1, 3]  = new Enemy(Globals.UserLevel, new Point(1, 3), "Sergeant");
            _locations[2, 3]  = new Enemy(Globals.UserLevel, new Point(2, 3), "Sergeant");
            _locations[5, 3]  = new Enemy(Globals.UserLevel, new Point(5, 3));
            _locations[14, 3] = new Enemy(Globals.UserLevel, new Point(14, 3));
            //set treasure spawns
            _locations[18, 3] = new Enemy(Globals.UserLevel, new Point(18, 3), "Lieutenant");

            _exit = new Point(4, 4);
        }
Ejemplo n.º 2
0
        public void NavRoomTwo()
        {
            Console.Clear();
            RoomTwo secondRoom = new RoomTwo();

            while (roomTwo)
            {
                Console.WriteLine(secondRoom.RoomDescription);
                Console.WriteLine("1. Go to door.\n" +
                                  "2. search room \n" +
                                  "3. Go back to entrance.");

                string input = Console.ReadLine();

                switch (input)
                {
                case "1":
                    Console.WriteLine("You open the door");
                    roomTwo  = false;
                    roomFour = true;
                    NavRoomFour();
                    break;

                case "2":
                    roomTwoSearch();
                    break;

                case "3":
                    roomTwo = false;
                    roomOne = true;
                    NavRoomOne();
                    break;

                default:
                    Console.WriteLine("Not a valid input");
                    break;
                }
            }
        }