/// <summary> /// Boss room constructor /// </summary> /// <param name="finalBoss">Pass in true only if this is the final boss room</param> public Room(double level, Player player, bool finalBoss = false) { //Put the boss in the room // indicies 1-4 should be empty enemies = new Enemy[5]; if (finalBoss == false) { EnemyType temp = EnemiesDirectory.RANDOM(); enemies[0] = new Enemy(temp, level * 3, new Point(650, 100), 150, 380, player, temp.HatPosition); } else { enemies[0] = new Enemy(EnemiesDirectory.BOSS, level * 3, new Point(650, 100), 150, 380, player, EnemiesDirectory.BOSS.HatPosition); } enemies[0].Name += " Boss"; enemies[1] = null; enemies[2] = null; enemies[3] = null; enemies[4] = null; //Give the boss hats for (int k = 0; k < level; k++) { HatsDirectory.GetRandomHat(level * 2).Equip(enemies[0]); } //A currentAttacker of 5 indicates that all enemies have attacked IsVisible = false; currentAttacker = 0; description = ""; }
/// <summary> /// Initializes content that requires textures or fonts /// </summary> private void PostInitialize() { EnemiesDirectory.SetUp(); RoomsDirectory.ReadRooms("temp"); HatsDirectory.SetUp(); menu = new Menu(); instructions = new Instructions(); play = new Play(); }
//Properties public EnemyType this[int i] { get { if (i >= 0 && i < 5) { if (!enemies[i].IsRandom) { return(enemies[i]); } else { return(EnemiesDirectory.RANDOM()); } } else { throw new IndexOutOfRangeException(); } } }