Ejemplo n.º 1
0
        /// <summary>
        /// </summary>
        public override void LoadContent()
        {
            base.LoadContent();

            //We enable diagnostics to show get values for our performance counters.
            Settings.EnableDiagnostics = true;

            if (World == null)
            {
                World = new World(Vector2.Zero);
            }
            else
            {
                World.Clear();
            }

            if (DebugView == null)
            {
                DebugView = new DebugViewXna(World);
                DebugView.LoadContent(ScreenManager);
            }

            if (Camera == null)
            {
                Camera = new Camera2D(ScreenManager.GraphicsDevice);
            }
            else
            {
                Camera.ResetCamera();
            }

            // Loading may take a while... so prevent the game from "catching up" once we finished loading
            ScreenManager.Game.ResetElapsedTime();
        }
Ejemplo n.º 2
0
 /// <summary>
 /// </summary>
 protected PhysicsGameScreen()
 {
     TransitionOnTime    = TimeSpan.FromSeconds(0.75);
     TransitionOffTime   = TimeSpan.FromSeconds(0.75);
     EnableCameraControl = true;
     World     = null;
     Camera    = null;
     DebugView = null;
 }