private void addEnemiesToEachLevelOfEnemies(int level, List <EnemyShip> listOfEnemies) { var amountOfEnemiesForCurrentLevel = GetAmountOfShipForLevel(level); for (var i = 0; i < amountOfEnemiesForCurrentLevel; i++) { if (level == (int)ShipFactory.ShipSelections.Level1EnemyShip) { var ship = (EnemyShip)ShipFactory.SelectShip(ShipFactory.ShipSelections.Level1EnemyShip); listOfEnemies.Add(ship); } else if (level == (int)ShipFactory.ShipSelections.Level2EnemyShip) { var ship = (EnemyShip)ShipFactory.SelectShip(ShipFactory.ShipSelections.Level2EnemyShip); listOfEnemies.Add(ship); } else if (level == (int)ShipFactory.ShipSelections.Level3EnemyShip) { var ship = (EnemyShip)ShipFactory.SelectShip(ShipFactory.ShipSelections.Level3EnemyShip); listOfEnemies.Add(ship); } else if (level >= (int)ShipFactory.ShipSelections.DefaultEnemyShip) { var ship = (EnemyShip)ShipFactory.SelectShip(ShipFactory.ShipSelections.DefaultEnemyShip); listOfEnemies.Add(ship); } } }
private void addBonusEnemyToGame() { var randomInt = RandomUtil.GetNextRandomFromMax(30); if (this.bonusEnemyShip == null) { this.bonusEnemyShip = (EnemyShip)ShipFactory.SelectShip(ShipFactory.ShipSelections.BonusShip); this.currentBackground.Children.Add(this.bonusEnemyShip.Sprite); this.placeBonusEnemyShip(); } }
private void addLives(int amountOfLives) { var initialPlayerShip = (PlayerShip)ShipFactory.SelectShip(ShipFactory.ShipSelections.PlayerShip); lives.Add(initialPlayerShip); for (var i = 0; i < amountOfLives; i++) { var aPlayerShip = (PlayerShip)ShipFactory.SelectShip(ShipFactory.ShipSelections.PlayerShip); lives.Add(aPlayerShip); } var bufferPlayerShip = (PlayerShip)ShipFactory.SelectShip(ShipFactory.ShipSelections.PlayerShip); lives.Add(bufferPlayerShip); }