Ejemplo n.º 1
0
        /// <summary>
        /// Allows the game to run logic.
        /// </summary>
        protected override void Update(GameTime gameTime)
        {
            // Update the command manager (updates polling input and fires input events)
            commandManager.Update();

            collisionManager.Update();

            // Update the ship
            ship.Update(gameTime);

            // Update enemies
            foreach (EnemyShip enemy in enemies)
            {
                enemy.Update(gameTime);
            }

            // Update the camera to chase the new target
            UpdateCameraChaseTarget();

            // The chase camera's update behavior is the springs, but we can
            // use the Reset method to have a locked, spring-less camera
            if (cameraSpringEnabled)
            {
                camera.Update(gameTime);
            }
            else
            {
                camera.Reset();
            }


            base.Update(gameTime);
        }
        /// <summary>
        /// Allows the game to run logic.
        /// </summary>
        protected override void Update(GameTime gameTime)
        {
            // Update the command manager (updates polling input and fires input events)
            commandManager.Update();

            collisionManager.Update();

            world.UpdateWorld(gameTime);

            base.Update(gameTime);
        }