Esempio n. 1
0
        private void RoomToDungeon()
        {
            for (var i = 0; i < 5; i++)
            {
                for (var j = 0; j < 5; j++)
                {
                    if (_dungeonArray[i, j] == "_")
                    {
                        var doors     = DoorGenCheck(i, j);
                        var tileArray = _room.GenerateRoom(20, 20, doors);
                        var roomInfo  = new RoomInfo("_", tileArray, _rnd);
                        _enemyArray[i, j] = roomInfo.GenerateEnemies();
                        _worldArray[i, j] = tileArray;
                    }
                    else if (_dungeonArray[i, j] == "S")
                    {
                        var enemyArray = new String[2, 2];
                        var spawnEnemy = new SpawnEnemy(enemyArray, _content);

                        _activeEnemies = spawnEnemy.Spawn();

                        var doors     = DoorGenCheck(i, j);
                        var tileArray = _room.GenerateRoom(20, 20, doors);
                        var roomInfo  = new RoomInfo("_", tileArray, _rnd);
                        _worldArray[i, j] = tileArray;
                        _activeRoom       = _worldArray[i, j];
                        var indX = i;
                        var indY = j;
                        _roomIndex[0] = indX;
                        _roomIndex[1] = indY;
                        _pathFinding  = new PathFinding(_activeRoom);
                    }
                }
            }
        }
Esempio n. 2
0
 private void ChangeRooms(int x, int y)
 {
     _activeEnemies = new List <Enemy>();
     if (_enemyArray[x, y] != null)
     {
         var spawnEnemy = new SpawnEnemy(_enemyArray[x, y], _content);
         _activeEnemies = spawnEnemy.Spawn();
     }
 }