Exemplo n.º 1
0
        /// <summary>
        /// Allows the game component to update itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        public override void Update(GameTime gameTime)
        {
            // base first because base handles collision events which might dispose "this"
            base.Update(gameTime);

            if (isDisposed)
            {
                return;
            }

            // Update AI
            AI.UpdateAI(gameTime);
            if (FxSound != null)
            {
                if (Player.GetDistanceToPlayer(game, GlobalPosition, 0) <= 200)
                {
                    if (!FxSound.Loop)
                    {
                        FxSound.Loop = true;
                    }
                }
                else
                if (FxSound.Loop)
                {
                    FxSound.Loop = false;
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Allows the game component to update itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        public override void Update(GameTime gameTime)
        {
            // base first because base handles collision events which might dispose "this"
            base.Update(gameTime);

            AIStates.UpdateAI(gameTime);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Allows the game component to update itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        public override void Update(GameTime gameTime)
        {
            // base first because base handles collision events which might dispose "this"
            base.Update(gameTime);

            if (isDisposed)
            {
                return;
            }

            // Update AI
            AI.UpdateAI(gameTime);
        }