Exemplo n.º 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()
        {
            debugFont = Content.Load <SpriteFont>("font_atari10s");

            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            //load various textures
            heroTex = new List <Texture2D>();
            heroTex.Add(Content.Load <Texture2D>("hero\\hero_pirate"));
            monsterTex = new List <Texture2D>();
            monsterTex.Add(Content.Load <Texture2D>("monster\\monster_goblin"));
            itemTex = new List <Texture2D>();
            itemTex.Add(Content.Load <Texture2D>("item\\treasure_sack"));
            powerTex = new List <Texture2D>();
            powerTex.Add(Content.Load <Texture2D>("power\\power_fireball"));

            //load textures for gui elements and create gui
            Texture2D fb = this.Content.Load <Texture2D>("gui_frameborders");

            gui = new GUI(GraphicsDevice, Content, new Color(20, 20, 100, 180), new Color(100, 100, 220, 180));
            gui.mainMenu.AddChild("New Game", null);
            gui.mainMenu.children[0].AddChild("Warrior", NewGame);
            gui.mainMenu.children[0].AddChild("Archer", NewGame);
            gui.mainMenu.children[0].AddChild("Rogue", NewGame);
            gui.mainMenu.children[0].AddChild("Wizard", NewGame);
            gui.mainMenu.children[0].AddChild("Ascetic", NewGame);
            gui.mainMenu.children[0].AddChild("Mystic", NewGame);
            gui.mainMenu.AddChild("Continue", ContinueGame);
            gui.mainMenu.AddChild("Tutorial", OpenTutorial, GUI.mItemStatus.Disabled);
            gui.mainMenu.AddChild("Options", OpenOptions, GUI.mItemStatus.Disabled);
            gui.mainMenu.AddChild("Graveyard", OpenGraveyard);
            gui.mainMenu.AddChild("Exit Game", EndGame);
            gui.mainMenu.OpenMenu(GraphicsDevice.Viewport.Width / 2, 100);

            //load tileset and generate map
            tileSetImg   = this.Content.Load <Texture2D>("tileset_basic");
            objectSetImg = this.Content.Load <Texture2D>("objectset_basic");
            mapGen       = new MapGen();

            heroGen = new HeroGen();
        }
Exemplo n.º 2
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            debugFont = Content.Load<SpriteFont>("font_atari10s");

            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            //load various textures
            heroTex = new List<Texture2D>();
            heroTex.Add(Content.Load<Texture2D>("hero\\hero_pirate"));
            monsterTex = new List<Texture2D>();
            monsterTex.Add(Content.Load<Texture2D>("monster\\monster_goblin"));
            itemTex = new List<Texture2D>();
            itemTex.Add(Content.Load<Texture2D>("item\\treasure_sack"));
            powerTex = new List<Texture2D>();
            powerTex.Add(Content.Load<Texture2D>("power\\power_fireball"));

            //load textures for gui elements and create gui
            Texture2D fb = this.Content.Load<Texture2D>("gui_frameborders");
            gui = new GUI(GraphicsDevice, Content, new Color(20, 20, 100, 180), new Color(100, 100, 220, 180));
            gui.mainMenu.AddChild("New Game", null);
            gui.mainMenu.children[0].AddChild("Warrior", NewGame);
            gui.mainMenu.children[0].AddChild("Archer", NewGame);
            gui.mainMenu.children[0].AddChild("Rogue", NewGame);
            gui.mainMenu.children[0].AddChild("Wizard", NewGame);
            gui.mainMenu.children[0].AddChild("Ascetic", NewGame);
            gui.mainMenu.children[0].AddChild("Mystic", NewGame);
            gui.mainMenu.AddChild("Continue", ContinueGame);
            gui.mainMenu.AddChild("Tutorial", OpenTutorial, GUI.mItemStatus.Disabled);
            gui.mainMenu.AddChild("Options", OpenOptions, GUI.mItemStatus.Disabled);
            gui.mainMenu.AddChild("Graveyard", OpenGraveyard);
            gui.mainMenu.AddChild("Exit Game", EndGame);
            gui.mainMenu.OpenMenu(GraphicsDevice.Viewport.Width / 2, 100);

            //load tileset and generate map
            tileSetImg = this.Content.Load<Texture2D>("tileset_basic");
            objectSetImg = this.Content.Load<Texture2D>("objectset_basic");
            mapGen = new MapGen();

            heroGen = new HeroGen();
        }