Example #1
0
 protected LevelBase()
 {
     TransitionOnTime = TimeSpan.FromSeconds( 0.75 );
     TransitionOffTime = TimeSpan.FromSeconds( 0.75 );
     HasCursor = true;
     EnableCameraControl = true;
     _userAgent = null;
     World = null;
     Camera = null;
     DebugView = null;
 }
Example #2
0
        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.RemoveFlags( DebugViewFlags.Shape );
                DebugView.RemoveFlags( DebugViewFlags.Joint );
                DebugView.DefaultShapeColor = Color.White;
                DebugView.SleepingShapeColor = Color.LightGray;
                DebugView.LoadContent( ScreenManager.GraphicsDevice, ScreenManager.Content );
            }

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

            // Loading may take a while... so prevent the game from "catching up" once we finished loading
            ScreenManager.Game.ResetElapsedTime();
        }