Example #1
0
        /// <summary>
        /// The update.
        /// </summary>
        /// <param name="gameTime">
        /// The game time.
        /// </param>
        public override void Update(GameTime gameTime)
        {
            AdjacencyManager.PopulateAdjacency(this.ID);

            if (this.mainGameScene)
            {
                Audio.RepeatPlayBackgroundMusic();
            }
            if (this.InputManager != null)
            {
                this.InputManager.Update();
            }

            if (this.mainGameScene && this.EnablePhysics)
            {
                this.physicsSimulator.Update((float)gameTime.ElapsedGameTime.TotalMilliseconds / 1000.0f);
            }

            for (int index = 0; index < ObjectManager.sceneComponents[this.ID].Count; index++)
            {
                SceneComponent sc = ObjectManager.sceneComponents[this.ID][index];
                if (sc.Enabled)
                {
                    sc.Update(gameTime);
                }
            }

            if (this.camera != null)
            {
                this.bounds.Center = this.camera.LookAt;
                this.camera.Update(gameTime);
            }
        }