Exemple #1
0
        public override void UpdateGameState(GameTime gameTime)
        {
            if (_explosion == null && gameTime.TotalGameTime > TimeSpan.FromSeconds(2))
            {
                _explosion = new ExplosionEmitter(LoadTexture(CloudTexture), new Vector2(260, 60));
                AddGameObject(_explosion);
                _explodeAt = gameTime.TotalGameTime;
            }

            if (_explosion != null && gameTime.TotalGameTime - _explodeAt > TimeSpan.FromSeconds(1.2))
            {
                _explosion.Deactivate();
            }

            if (_explosion != null && gameTime.TotalGameTime - _explodeAt > TimeSpan.FromSeconds(0.5))
            {
                RemoveGameObject(_chopper);
            }

            if (_explosion != null && gameTime.TotalGameTime > TimeSpan.FromSeconds(10))
            {
                RemoveGameObject(_explosion);
            }

            if (_explosion != null)
            {
                _explosion.Update(gameTime);
            }
        }