コード例 #1
0
        /// Load graphics content for the game.
        public override void LoadContent()
        {
            if (content == null)
                content = new ContentManager(ScreenManager.Game.Services, "Content");
            currentLevel = new Level1(content, ScreenManager.SpriteBatch);
            gameFont = content.Load<SpriteFont>("fonts/gamefont");
            //Used for drawing UI
            spriteBatch = ScreenManager.SpriteBatch;

            player = new Player(content);
            player.resetScore();
            Level.Add(player); //add the player

            UI = content.Load<Texture2D>("ui/UI");
            ShieldBar = content.Load<Texture2D>("ui/shieldbar");
            PowerupBar = content.Load<Texture2D>("ui/powerupbar");
            Needle = content.Load<Texture2D>("ui/Needles");
            Missile = content.Load<Texture2D>("ui/Missile");
            Shield = content.Load<Texture2D>("ui/Shield");
            border = content.Load<Texture2D>("textures/borderTexture");
            // once the load has finished, we use ResetElapsedTime to tell the game's
            // timing mechanism that we have just finished a very long frame, and that
            // it should not try to catch up.
            ScreenManager.Game.ResetElapsedTime();
        }