コード例 #1
0
        public void LoadAll()
        {
            //load sound effects
            music          = Content.Load <Song>("Sounds/Unseen Horrors");
            reload         = Content.Load <SoundEffect>("Sounds/reload");
            pistolFire     = Content.Load <SoundEffect>("Sounds/pistolLicenseAttribution3");
            machineFire    = Content.Load <SoundEffect>("Sounds/machine gun");
            shotgunFire    = Content.Load <SoundEffect>("Sounds/Shotgunsound");
            shells         = Content.Load <SoundEffect>("Sounds/shell");
            stab           = Content.Load <SoundEffect>("Sounds/Stab");
            damagedPlayer  = Content.Load <SoundEffect>("Sounds/damagedplayer");
            damagedPlayer2 = Content.Load <SoundEffect>("Sounds/damagedplayer2");
            dryFire        = Content.Load <SoundEffect>("Sounds/Dry Fire Gun-SoundBible.com-2053652037");
            zombieDamage   = Content.Load <SoundEffect>("Sounds/zombiedamage");
            zombie1        = Content.Load <SoundEffect>("Sounds/Zombie 1");
            zombie2        = Content.Load <SoundEffect>("Sounds/Zombie 2");
            zombie3        = Content.Load <SoundEffect>("Sounds/Zombie 3");
            zombie4        = Content.Load <SoundEffect>("Sounds/Zombie 4");
            zombie5        = Content.Load <SoundEffect>("Sounds/Zombie 5");
            zombie6        = Content.Load <SoundEffect>("Sounds/Zombie 6");
            zombie7        = Content.Load <SoundEffect>("Sounds/Zombie 7");


            // load game elements
            elements.LoadContent();
            objFont = Content.Load <SpriteFont>(@"Fonts\VtksMoney_30");
        }
コード例 #2
0
ファイル: Game1.cs プロジェクト: eccyy/The-scroll-of-NOPE
        /// <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);
            GameElements.LoadContent(Content, Window);
            mapEditor = new LevelObjects.LevelEditor();

            // Load the textures into the texture handler
            textures = new The_scroll_of_NOPE.Content.TextureHandler(Content);
#region Jonatan, load map
            // FOR DEBUG PUSPOSES
            tmpTexture = Content.Load<Texture2D>("images/ANKA/ANKA");

            try
            {
                // Load the default map
                levelLayout = mapEditor.LoadMap("defaultMap");

                // If it could not load because there probably was no defaultMap
                if (levelLayout == null)
                {
                    // Create new map and save it to a file
                    levelLayout = new LevelObjects.LevelLayout(Content);
                    mapEditor.SaveMap(levelLayout, "defaultMap");
                }
            }
            // Textures probably did not load properly
            // TODO: Fix the deserialization and serialization of textures
            catch
            {
                levelLayout = new LevelObjects.LevelLayout(Content);
            }
         
           
#endregion
            anka = new BaseClasses.Players.ANKA(1, Content.Load<Texture2D>("images/ANKA/SpriteTest"/*SpriteTest skall vara ANKA*/), new Vector2(50, 50), 5, 10000);
            testStudent = new Student1(Content.Load<Texture2D>("images/Students/PlayerTemp"), new Vector2(0, 0), 7, Content, new Vector2(5, 5));
            
            // TODO: use this.Content to load your game content here
            collidables.Add(anka);
            collidables.Add(levelLayout);
            collidables.Add(testStudent);

            // For drawing text
            font = Content.Load<SpriteFont>("Text/Score");
            winFont = Content.Load<SpriteFont>("Text/Win");
            // for drawing whatever

        }