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

            // in game content
            block  = Content.Load <Texture2D>("block");
            font   = Content.Load <SpriteFont>("Score");
            window = Content.Load <Texture2D>("Window");
            space  = Content.Load <Texture2D>("maxresdefault");

            //game menu
            playGame   = Content.Load <Texture2D>("PlayGame");
            options    = Content.Load <Texture2D>("options");
            background = Content.Load <Texture2D>("tetris_logo");

            optionButton = new Button(new Rectangle(400, 100, options.Width, options.Height), true);
            optionButton.load(Content, "options");

            playGameButton = new Button(new Rectangle(200, 75, playGame.Width + 100, playGame.Height), true);
            playGameButton.load(Content, "PlayGame");

            //Music
            themeSong               = Content.Load <Song>("Tetris");
            MediaPlayer.Volume      = 0.1f;
            MediaPlayer.IsRepeating = true;
            //MediaPlayer.Play(themeSong);
        }