コード例 #1
0
        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();
            }
        }
コード例 #2
0
        public static void Update(GameTime gameTime)
        {
            UiSideScreen.Update();
            UiTopScreen.Update();

            WaveManager.Update(gameTime);
            TowerManager.Update();
            EffectManager.Update(gameTime);
        }