public static void ResetEnt() { if (penguin.Lives >= 0) { for (int i = 0; i < 2; i++) { if (Map.orcasMap.Count > 0) { int randomIndex = RandomGenerator.GetInstance().Next(Map.orcasMap.Count); Point orcasLocation = Map.orcasMap[randomIndex]; Orcas orca = new Orcas(penguin, orcasLocation.X, orcasLocation.Y); Map.eData[orcasLocation.X, orcasLocation.Y] = orca; } if (Map.fishMap.Count > 0) { int randomIndex = RandomGenerator.GetInstance().Next(Map.fishMap.Count); Point foodLocation = Map.fishMap[randomIndex]; FoodFish fish = new FoodFish(foodLocation.X, foodLocation.Y); Map.eData[foodLocation.X, foodLocation.Y] = fish; } if (Map.crabMap.Count > 0) { int randomIndex = RandomGenerator.GetInstance().Next(Map.crabMap.Count); Point foodLocation = Map.crabMap[randomIndex]; FoodCrab crab = new FoodCrab(foodLocation.X, foodLocation.Y); Map.eData[foodLocation.X, foodLocation.Y] = crab; } } } else { gameOver = true; } }
public BattleWindow(Penguin penguin, Orcas orca) { InitializeComponent(); this.penguin = penguin; this.orca = orca; }