예제 #1
0
        public void OnTap(IMapObject obj)
        {
            var randomSizeRoom = new Random();

            player.numberCurrentRoom++;

            if (player.numberCurrentRoom > rooms.Count - 1)
            {
                rooms.Add(LevelGenerator.CreateFillRoom());
            }

            DungeonRoom.currentDungeonRoom.RemoveFillObject(player);
            DungeonRoom.currentDungeonRoom = rooms[player.numberCurrentRoom];
            DungeonRoom.currentDungeonRoom.AddToFill(player);

            player.position = DungeonRoom.currentDungeonRoom.startDoor.CheckDoor(DungeonRoom.currentDungeonRoom.currentCells);

            EventLog.doEvent("Игрок: перешел в " + (player.numberCurrentRoom + 1) + " комнату", ConsoleColor.DarkGreen);
        }
예제 #2
0
        //private static LevelGenerator levelGenerator = new LevelGenerator();

        static public void Initialization()
        {
            rooms.Clear();

            var randomSizeRoom = new Random();

            player = new Player();

            rooms.Add(LevelGenerator.CreateFillRoom());

            DungeonRoom.currentDungeonRoom = rooms[0];

            DungeonRoom.currentDungeonRoom.AddToFill(new Trap(new Point(2, 4)));

            DungeonRoom.currentDungeonRoom.AddToFill(player);

            player.numberCurrentRoom = rooms.IndexOf(DungeonRoom.currentDungeonRoom);
            player.position          = new Point(
                (DungeonRoom.currentDungeonRoom.currentCells.GetLength(0) - 1) / 2,
                (DungeonRoom.currentDungeonRoom.currentCells.GetLength(1) - 1) / 2);

            Console.CursorVisible = false;
        }
예제 #3
0
        static public void Initialization()
        {
            rooms.Clear();

            var randomSizeRoom = new Random();

            player = new Player();

            rooms.Add(LevelGenerator.CreateFillRoom());

            DungeonRoom.currentDungeonRoom = rooms[0];

            //DungeonRoom.currentDungeonRoom.AddToFill(new Trap(new Point(2,4)));
            DungeonRoom.currentDungeonRoom.AddToFill(player);

            player.numberCurrentRoom = rooms.IndexOf(DungeonRoom.currentDungeonRoom);
            player.position          = new Point(
                (DungeonRoom.currentDungeonRoom.currentCells.GetLength(0) - 1) / 2,
                (DungeonRoom.currentDungeonRoom.currentCells.GetLength(1) - 1) / 2);

            Console.CursorVisible = false;

            //player.inventory.AddItems(new List<IInventoryObject> {new Sword(1,1), new Sword(1, 1), new Sword(1, 1), new Sword(1, 1), new Sword(1, 1), new Sword(1, 1), new Sword(1, 1), new Sword(1, 1), new Sword(1, 1), new Sword(1, 1), new Sword(1, 1), new HealPotion() });
        }