コード例 #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);
            background = Content.Load<Texture2D>(@"graphics/level/Background");
            cloud1 = Content.Load<Texture2D>(@"graphics/level/cloud_01");
            cloud2 = Content.Load<Texture2D>(@"graphics/level/cloud_02");
            tetrisBatch = new TetrisPieceBatch(GraphicsDevice, Content);
            playerSwitchTexture = Content.Load<Texture2D>(@"graphics/gui/PlayerSwitch");

            // Load sound
            MusicManager.LoadMusic(Content, "background", "background");
            SoundManager.LoadSound(Content, "bell", "bell-01");
            SoundManager.LoadSound(Content, "collect_powerup", "powerup-01");
            SoundManager.LoadSound(Content, "splash", "splash-03");
            MusicManager.MaxVolume = 0.25f;
            SoundManager.SoundVolume = 1.0f;

            // Reset player state
            platform.ResetPlayer();
        }
コード例 #2
0
        protected override void LoadContent()
        {
            drawer = new TetrisPieceBatch(GraphicsDevice, Game.Content);

            string[] shapeNames = new string[] { "LR", "LL", "O", "T", "I", "MZ", "Z", "I1", "I2", "I3" };
            for (int i = 0; i < shapeNames.Length; i++)
            {
                string n = "shapes/" + shapeNames[i];
                tetrisTextures.Add(Game.Content.Load<Texture2D>(n));
            }

            base.LoadContent();
        }
コード例 #3
0
 protected override void LoadContent()
 {
     platformTexture = parent.Content.Load<Texture2D>("graphics/level/platform");
     drawer = new TetrisPieceBatch(GraphicsDevice, Game.Content);
 }