Пример #1
0
        private void CheckRoomChange()
        {
            CardinalPoint?nullableExitCardinalPoint = DungeonUtilities.GetExitFromPosition(player.position);

            if (nullableExitCardinalPoint != null)
            {
                CardinalPoint exitCardinalPoint = (CardinalPoint)nullableExitCardinalPoint;
                dungeon.ChangeRoom(exits[exitCardinalPoint], exitCardinalPoint.Opposite());
            }
        }
Пример #2
0
        public Room(Vector2 position, Dungeon dungeon, Player player, ContentManager contentManager)
        {
            this.position       = position;
            this.player         = player;
            this.dungeon        = dungeon;
            _state              = States.InGame;
            enemies             = new List <Enemy>();
            chests              = new List <Chest>();
            this.contentManager = contentManager;
            font = contentManager.Load <SpriteFont>("font");

            for (var i = 0; i < DungeonUtilities.GetNumberOfEnemies(dungeon.dungeonNumber); i++)
            {
                enemies.Add(new Enemy(GenerateRandomPosition(), this));
            }

            for (var i = 0; i < GetNumberOfChestsToGenerate(); i++)
            {
                chests.Add(new Chest(GenerateRandomPosition(), dungeon));
            }

            GenerateRoomFloor();
        }