//Called for every wave public void Spawn(EnemyConfig enemy) { switch (enemy.enemyType) { case EnemyType.EnemyA: spawnA.MyEnemyConfig = enemy; spawnA.execute(); break; case EnemyType.EnemyB: spawnB.MyEnemyConfig = enemy; spawnB.execute(); break; case EnemyType.MidBoss: spawnMid.MyEnemyConfig = enemy; spawnMid.execute(); break; case EnemyType.FinalBoss: spawnFinal.MyEnemyConfig = enemy; spawnFinal.execute(); break; } }
public EnemyConfig(EnemyConfig copy) { this.enemyType = copy.enemyType; this.movementPattern = copy.movementPattern; this.health = copy.health; this.acceleration = copy.acceleration; this.velocity = copy.velocity; this.randomSpawn = copy.randomSpawn; this.fireRate = copy.fireRate; this.direction = new Position(copy.direction); this.bulletType = copy.bulletType; this.count = copy.count; this.spawnInterval = copy.spawnInterval; }
public Wave ConfigureWave(WaveConfig waveConfigs, int index) { //Grab list of enemy configs at index List <EnemyConfig> waveConfig = waveConfigs.waves[index]; List <EnemyConfig> wave = new List <EnemyConfig>(); //For each enemy in the wave for (int i = 0; i < waveConfig.Count; ++i) { //Save enemy config to send to enemy manager EnemyConfig enemy = waveConfig[i]; ////Send to enemy info to the enemy manager to spawn //_enemyManager.Spawn(enemy); //Add enemy config to list of enemies in wave wave.Add(enemy); } //Return new wave config return(new Wave(wave)); }