Exemple #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);
            items = Content.Load<Library.Item[]>(@"Data/ItemXML");
            foreach (Item item in items)
            {
                item.Initialize(Content.Load<Texture2D>(@item.TextureString));
            }
            Registry.items = items;
            cursor = Content.Load<Texture2D>(@"Images/MenuImages/cursor");
            cursor2 = Content.Load<Texture2D>(@"Images/MenuImages/cursor2");
            waitcursor = Content.Load<Texture2D>(@"Images/MenuImages/wait");
            player = new Player(this, Content.Load<Texture2D>(@"Images/AnimatedSprites/vanligTexture"), Content.Load<Texture2D>(@"Images/AnimatedSprites/militarTexture"),
                Content.Load<Texture2D>(@"Images/AnimatedSprites/damjerry"), Content.Load<Texture2D>(@"Images/AnimatedSprites/jerrybaby"),
                Content.Load<Texture2D>(@"Images/AnimatedSprites/jkeaTexture"), Content.Load<Texture2D>(@"Images/AnimatedSprites/skalligTexture"),
                Content.Load<Texture2D>(@"Images/AnimatedSprites/finJerry"), Content.Load<Texture2D>(@"Images/AnimatedSprites/fallTexture"),
                Content.Load<Texture2D>(@"Images/AnimatedSprites/nyJerry"), Content.Load<Texture2D>(@"Images/AnimatedSprites/finkladd2"),
                Content.Load<Texture2D>(@"Images/Sprites/invBackground"), Window.ClientBounds);

            menu = new Menu(Content.Load<Texture2D>(@"Images/MenuImages/splash"), Content.Load<Texture2D>(@"Images/MenuImages/OPENBUTTON"), Content.Load<Texture2D>(@"Images/MenuImages/NEWBUTTON"));

            Registry.npcs = Content.Load<Library.NPC[]>(@"Data/npcs");              // Här händer viktiga saker. NPC-listan i registret skapas
            Registry.dialogs = Content.Load<Library.Dialog[]>(@"Data/dialogs");     // Dialoglistan i Registry skapas
            Registry.rooms = Content.Load<Library.Room[]>(@"Data/rooms");           // Rum i Registry skapas
            Registry.currentRoom = Registry.rooms[54];                               // Startrummet
            Registry.currentRoom.LoadContent(this);                                 // GO!
        }