Пример #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);

            // TODO: use this.Content to load your game content here

            // background music
            startMusic      = Content.Load <Song>("Sounds/StartMusic");
            backgroundMusic = Content.Load <Song>("Sounds/BackgroundMusic");
            click           = Content.Load <SoundEffect>("Sounds/Click");

            //Graphics
            Texture2D menuBackground = this.Content.Load <Texture2D>("Images/Menu");
            Texture2D gameBackground = this.Content.Load <Texture2D>("Images/newbg");

            // Instantiate all scenes
            startScene = new StartScene(this, spriteBatch, startMusic, click, menuBackground);
            this.Components.Add(startScene);

            playScene1 = new PlayScene(this, spriteBatch, backgroundMusic, gameBackground, 1);
            this.Components.Add(playScene1);

            playScene2 = new PlayScene(this, spriteBatch, backgroundMusic, gameBackground, 2);
            this.Components.Add(playScene2);

            levelScene = new LevelScene(this, spriteBatch, click, menuBackground);
            this.Components.Add(levelScene);

            helpScene = new HelpScene(this, spriteBatch);
            this.Components.Add(helpScene);

            highScoreScene = new HighScoreScene(this, spriteBatch, menuBackground);
            this.Components.Add(highScoreScene);

            aboutScene = new AboutScene(this, spriteBatch, menuBackground);
            this.Components.Add(aboutScene);

            // Show only startScene and play start music
            startScene.Show();
            SwitchMusic(startMusic);
        }