示例#1
0
 // Switches the active screen to 'newScreen'
 public void switchScreens(GameScreen newScreen)
 {
     activescreen.Hide();
     activescreen = newScreen;
     activescreen.Show();
 }
示例#2
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);
            screenWidth = GraphicsDevice.Viewport.Width;
            screenHeight = GraphicsDevice.Viewport.Height;

            // Debug
            debugFont = Content.Load<SpriteFont>("DebugFont");
            debug = new Rectangle(0, 0, 3, 3);

            /*~~~~~~~~~~~~~~~~~*/

            camera = new Camera(this);

            player = new Player(this);

            currentLevel = new Level(this, player.currentLevel);

            keyControls = new kbdController(this, player.activeHero);

            Components.Add(currentLevel);

            activescreen = currentLevel;
            activescreen.Show();
        }