public static void Update(GameTime gameTime) { if (mouseSqrCoords != null) { MouseScreenPos = new Vector2(mouseSqrCoords.x * SQUARESIZE, mouseSqrCoords.y * SQUARESIZE + BORDERTOP); } m_manPower = TroopListener.TroopList.Count(); UiSideScreen.Update(); UiTopScreen.Update(); QuestionPopUpManager.Update(); WaveManager.Update(gameTime); TowerManager.Update(); TroopManager.Update(gameTime); EffectManager.Update(gameTime); PopUpTextManager.Update(gameTime); PopUpNotificationManager.Update(gameTime); MessageBoxManager.Update(gameTime); if (BaseHealth <= 0) { if (EffectManager.EffectList.Count < 10) { for (int i = 0; i < 1; i++) { EffectManager.EffectCall(EffectManager.EffectEnums.Explosion, new Vector2(ENDPOINT.x * SQUARESIZE + rnd.Next(-30, 60), ENDPOINT.y * SQUARESIZE + BORDERTOP + rnd.Next(-30, 60)), true); } } GameState = GameStates.LoseScreen; } if (GameState == GameStates.LoseScreen && SaveData) { SaveData = false; Scores.AllTimeKills += WaveManager.EnemiesKilled; if (Scores.HighestWaveKills <= WaveManager.EnemiesKilled && Scores.HighestWave <= WaveManager.WaveNumber) { Scores.HighestWaveKills = WaveManager.EnemiesKilled; Scores.HighestWave = WaveManager.WaveNumber; } Scores.SaveData(Scores); } if (GameState == GameStates.PlayScreen && !SaveData) { SaveData = true; } if (HelpMode) { HelpDialogManager.Update(); } }
static void ResourceManpowerNotification() { if (GameManager.Manpower < ManPower) { PopUpNotificationManager.Add(new PopUpNotificationText(PopUpNotificationManager.NoManpower, GameManager.MouseScreenPos, Color.Red)); } else if (GameManager.Resources < Resources) { PopUpNotificationManager.Add(new PopUpNotificationText(PopUpNotificationManager.NoResources, GameManager.MouseScreenPos, Color.Red)); } }
public static void Draw(SpriteBatch sb) { EffectManager.Draw(sb, 0); TowerManager.Draw(sb); EnemyManager.Draw(sb); TroopManager.Draw(sb); EffectManager.Draw(sb, 1); PopUpTextManager.Draw(sb); QuestionPopUpManager.Draw(sb); PopUpNotificationManager.Draw(sb); MessageBoxManager.Draw(sb); if (HelpMode) { HelpDialogManager.Draw(sb); } }
static void BlockedNotification() { PopUpNotificationManager.Add(new PopUpNotificationText(PopUpNotificationManager.CantPlaceTrench, GameManager.MouseScreenPos, Color.Red)); }
static void NeedConcreteNotification() { PopUpNotificationManager.Add(new PopUpNotificationText(PopUpNotificationManager.NeedConcrete, GameManager.MouseScreenPos, Color.Red)); }
static void NextToTrenchNotification() { PopUpNotificationManager.Add(new PopUpNotificationText(PopUpNotificationManager.NextToTrench, GameManager.MouseScreenPos, Color.Red)); }