Ejemplo n.º 1
0
 public Room(List<Enemy> enemies, Tuple<int, int> roomIndex, Floor floor)
 {
     name = $"Room_{floor.floorIndex}_{roomIndex.Item1}.{roomIndex.Item2}";
     this.enemies = enemies;
     this.roomIndex = roomIndex;
     this.floor = floor;
 }
Ejemplo n.º 2
0
 public static Room RandomRoom(int counter, int minEnemies, int maxEnemies, Floor floor, int level,
     Tuple<int, int> roomIndex, Random rnd, int roomType)
 {
     // random room
     //string randomName = string.Format("Room_{0}_{0}", floor.floorIndex, counter);
     //Random rnd = game.random.GetRandom(randomName);
     var charactersInfo = new CharactersInfo(rnd);
     var numberOfEnemies = rnd.Next(minEnemies, maxEnemies);
     var randomEnemies = new List<Enemy>();
     for (var i = 0; i < numberOfEnemies; i++)
     {
         randomEnemies.Add(charactersInfo.randomEnemy(i + 1, level, roomType));
     }
     //string[] availableBackgroundAssets = new string[] { "background_0", "background_1" };
     //GameBackground gameBackground = new GameBackground (availableBackgroundAssets[rnd.Next(0, availableBackgroundAssets.Length)]);
     var room = new Room(randomEnemies, roomIndex, floor);
     room.roomType = roomType;
     return room;
 }
Ejemplo n.º 3
0
 public void InitializeNewFloor()
 {
     if (floorIndex > 0)
     {
         OnDestroyHelper(currentFloor.currentRoom);
     }
     floorIndex++;
     currentFloor = new Floor(floorIndex);
     engine.SpawnObject(currentFloor.name, currentFloor);
     currentFloor.RandomizeFloor((int) (6*Math.Max(1, (floorIndex + 1)/5.0)),
         (int) (8*Math.Max(1, (floorIndex + 1)/4.0)));
     currentFloor.OpenRoom(currentFloor.firstRoom);
 }