Esempio n. 1
0
        /// <summary>
        /// Actualizar los componentes del juego
        /// </summary>
        /// <param name="gameTime">Tiempo de juego</param>
        protected override void Update(GameTime gameTime)
        {
            if (Keyboard.GetState().IsKeyDown(Keys.Escape))
            {
                this.Exit();
            }

            InputHelper.Begin(gameTime);

            this.UpdateCamera();

            this.Physics.Update(gameTime);

            base.Update(gameTime);

            this.UpdateEnvironment(gameTime);

            this.UpdateVehicles(gameTime);

            string text = "Vehiculo  " + this.m_CurrentVehicle.Position.ToString() + Environment.NewLine;

            text += "Velocidad " + this.m_CurrentVehicle.Velocity.ToString() + Environment.NewLine;
            text += "Piloto    " + this.m_CurrentVehicle.AutoPilot.Enabled.ToString() + " " + this.m_CurrentVehicle.AutoPilot.Target.ToString() + " " + this.m_CurrentVehicle.AutoPilot.MaximumVelocity.ToString() + Environment.NewLine;
            text += "En Rango  " + this.m_CurrentVehicle.AutoPilot.OnRange.ToString() + " " + this.m_CurrentVehicle.AutoPilot.DistanceToTarget.ToString() + Environment.NewLine;
            if (this.m_Scenery != null)
            {
                text += "Terreno   " + this.m_Scenery.Scenery.Center.ToString() + Environment.NewLine;
            }

            text += "Camara    " + this.m_Camera.GetStatus() + Environment.NewLine;

            this.m_TextDrawer.WriteText(text, 5, 5);

            InputHelper.End();
        }
Esempio n. 2
0
        /// <summary>
        /// Actualiza la aplicación
        /// </summary>
        /// <param name="gameTime">Tiempo de juego</param>
        protected override void Update(GameTime gameTime)
        {
            // Fin de captura de salida de usuario
            InputHelper.Begin(gameTime);

            // Salir
            if (InputHelper.KeyUpEvent(Keys.Escape))
            {
                this.Exit();
            }

            // Reinicio
            if (InputHelper.KeyUpEvent(Keys.R))
            {
                this.Reset();
            }

            // Cámara
            this.UpdateCamera(gameTime);

            // Vehículos
            this.UpdateVehicles(gameTime);

            // Físicas
            this.Physics.Update(gameTime);

            // Actualización base
            base.Update(gameTime);

            // Fin de captura de entrada de usuario
            InputHelper.End();
        }