Пример #1
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            defaultFont = Content.Load <SpriteFont>("Default");
            RussianFont = Content.Load <SpriteFont>("Russian");

            MainSong              = Content.Load <SoundEffect>("sounds/soundtrack");
            MainInstance          = MainSong.CreateInstance();
            MainInstance.IsLooped = true;
            if (Settings.Music)
            {
                MainInstance.Play();
            }

            LevelsManager.Initialize(GraphicsDevice, Content);
            for (int i = 0; i < Levels; i++)
            {
                Engines.Add(new GameEngine(GraphicsDevice));
                Engines[i].CreateCamera(GraphicsDevice, (float)ScaleFactor);

                Engines[i].LoadContent(Content, LevelsManager.Get(i));
            }


            StartButton.LoadImage(Content, "misc/PlayButton");
            SettingsButton.LoadImage(Content, "misc/OptionsButton");

            CurrentSettingsUI.LoadContent(Content, "misc/OptionsButtonsAtlas");

            StartBG = Content.Load <Texture2D>("misc/BG");

            if (Settings.ShowTutorial)
            {
                TextBox.LoadContent(GraphicsDevice, Content, "misc/box_background");

                TutorialEngine.CreateCamera(GraphicsDevice, (float)ScaleFactor);
                TutorialEngine.LoadContent(Content, LevelsManager.Get(-1));
            }

            base.LoadContent();

            graphics.GraphicsDevice.PresentationParameters.PresentationInterval = PresentInterval.Two;
        }