Exemple #1
0
        protected override void LoadContent()
        {
            //Interface
            mBackground = new Background(1);
            Texture2D mainMenuBackground = MGame.Content.Load<Texture2D>("Sprites/Backgrounds/MainMenuBackground");
            mBackground.Load(MGame.GraphicsDevice, mainMenuBackground);
            //font
            font = MGame.Content.Load<SpriteFont>("Fonts/YoukaiFontSmall");
            descriptionBackgroundTexture = MGame.Content.Load<Texture2D>("Sprites/UI/InvScreen_DescBackground");
            descriptionBackgroundTextureBig = MGame.Content.Load<Texture2D>("Sprites/UI/InvScreen_DescBackground_Big");
            currentItemDescription = new StringBuilder();

            inventoryGridTexture = MGame.Content.Load<Texture2D>("Sprites/UI/InvScreen_Grid");
            goBackTextureRegular = MGame.Content.Load<Texture2D>("Sprites/UI/CC_ForwardButton");
            goBackTextureHover = MGame.Content.Load<Texture2D>("Sprites/UI/CC_ForwardButton_hover");
            goBackButton = new Button(goBackTextureRegular, goBackTextureHover);
            goBackButton.SetPosition(new Vector2(30, 420));
            slotsTexture = MGame.Content.Load<Texture2D>("Sprites/UI/InvScreen_Slots");

            Texture2D throwButtonTexture = MGame.Content.Load<Texture2D>("Sprites/UI/Guide_ThrowButton");
            Texture2D throwButtonTextureHover = MGame.Content.Load<Texture2D>("Sprites/UI/Guide_ThrowButton_hover");
            throwButton = new Button(throwButtonTexture, throwButtonTextureHover);
            Texture2D cancelButtonTexture = MGame.Content.Load<Texture2D>("Sprites/UI/Guide_CancelButton");
            Texture2D cancelButtonTextureHover = MGame.Content.Load<Texture2D>("Sprites/UI/Guide_CancelButton_hover");
            cancelButton = new Button(cancelButtonTexture, cancelButtonTextureHover);

            Texture2D mainHandButtonTexture = MGame.Content.Load<Texture2D>("Sprites/UI/Guide_MHand");
            Texture2D mainHandButtonTextureHover = MGame.Content.Load<Texture2D>("Sprites/UI/Guide_MHand_hover");
            Texture2D offHandButtonTexture = MGame.Content.Load<Texture2D>("Sprites/UI/Guide_OffHand");
            Texture2D offHandButtonTextureHover = MGame.Content.Load<Texture2D>("Sprites/UI/Guide_OffHand_hover");
            mainHandButton = new Button(mainHandButtonTexture, mainHandButtonTextureHover);
            offHandButton = new Button(offHandButtonTexture, offHandButtonTextureHover);
            itemSpritesCurrentlyUpdateable = true;
            //End interface

            //Equippables
            FillEquippables();
            //items and slots
            bagItemsVisualization = new List<ItemSprite>();
            FillBag();
        }
Exemple #2
0
 private void LoadBackground(LevelNumber levelNumber)
 {
     switch (levelNumber)
     {
         case LevelNumber.One:
             {
                 this.mBackground = new Background(4);
                 var background = MGame.Content.Load<Texture2D>("Sprites/Backgrounds/Background01");
                 mBackground.Load(MGame.GraphicsDevice, background);
             }
             break;
         case LevelNumber.Two:
             {
                 this.mBackground = new Background(1);
                 var background = MGame.Content.Load<Texture2D>("Sprites/Backgrounds/hauntedHouseBackground");
                 mBackground.Load(MGame.GraphicsDevice, background);
             }
             break;
     }
     WorldHeight = mBackground.WorldHeight;
     WorldWidth = mBackground.WorldWidth;
 }
Exemple #3
0
        protected override void LoadContent()
        {
            lme = new LevelManagement();
            mBackground = new Background(1);
            Texture2D mainMenuBackground = MGame.Content.Load<Texture2D>("Sprites/Backgrounds/MainMenuBackground");

            returnToGameTextureRegular = MGame.Content.Load<Texture2D>("Sprites/UI/PauseScreen_ReturnToGame");
            returnToGameTextureHover = MGame.Content.Load<Texture2D>("Sprites/UI/PauseScreen_ReturnToGame_hover");
            loadTextureRegular = MGame.Content.Load<Texture2D>("Sprites/UI/MainMenu_LoadButtonRegular");
            loadTextureHover = MGame.Content.Load<Texture2D>("Sprites/UI/MainMenu_LoadButtonHover");
            exitTextureRegular = MGame.Content.Load<Texture2D>("Sprites/UI/MainMenu_ExitButtonRegular");
            exitTextureHover = MGame.Content.Load<Texture2D>("Sprites/UI/MainMenu_ExitButtonHover");
            saveTextureRegular = MGame.Content.Load<Texture2D>("Sprites/UI/PauseScreen_SaveGame");
            saveTextureHover = MGame.Content.Load<Texture2D>("Sprites/UI/PauseScreen_SaveGame_hover");
            inventoryTextureRegular = MGame.Content.Load<Texture2D>("Sprites/UI/PauseScreen_Inventory");
            inventoryTextureHover = MGame.Content.Load<Texture2D>("Sprites/UI/PauseScreen_Inventory_hover");

            loadButton = new Button(loadTextureRegular, loadTextureHover);
            exitButton = new Button(exitTextureRegular, exitTextureHover);
            returnToGameButton = new Button(returnToGameTextureRegular, returnToGameTextureHover);
            saveButton = new Button(saveTextureRegular, saveTextureHover);
            inventoryButton = new Button(inventoryTextureRegular, inventoryTextureHover);
            loadButton.EnteringSelection += PlaySound;
            exitButton.EnteringSelection += PlaySound;
            returnToGameButton.EnteringSelection += PlaySound;
            saveButton.EnteringSelection += PlaySound;
            inventoryButton.EnteringSelection += PlaySound;

            returnToGameButton.SetPosition(new Vector2(MGame.GraphicsDevice.Viewport.Width / 2 - returnToGameTextureRegular.Width / 2, 150));
            saveButton.SetPosition(new Vector2(MGame.GraphicsDevice.Viewport.Width / 2 - saveTextureRegular.Width / 2, 200));
            loadButton.SetPosition(new Vector2(MGame.GraphicsDevice.Viewport.Width / 2 - loadTextureRegular.Width / 2, 250));
            inventoryButton.SetPosition(new Vector2(MGame.GraphicsDevice.Viewport.Width / 2 - inventoryTextureRegular.Width / 2, 300));
            exitButton.SetPosition(new Vector2(MGame.GraphicsDevice.Viewport.Width / 2 - exitTextureRegular.Width / 2, 350));

            mBackground.Load(MGame.GraphicsDevice, mainMenuBackground);
        }
        protected override void LoadContent()
        {
            mBackground = new Background(1);
            var mainMenuBackground = MGame.Content.Load<Texture2D>("Sprites/Backgrounds/MainMenuBackground");
            mBackground.Load(MGame.GraphicsDevice, mainMenuBackground);

            offerSelectionTexture = MGame.Content.Load<Texture2D>("Sprites/UI/CC_hero_selection_texture");
            offerSelectionSprite = new StillSprite(offerSelectionTexture);
            offerSelectionSprite.Position = new
                Vector2(MGame.GraphicsDevice.Viewport.Width / 2 - offerSelectionTexture.Width / 2, 80);

            //font
            font = MGame.Content.Load<SpriteFont>("Fonts/YoukaiFont");

            forwardReg = MGame.Content.Load<Texture2D>("Sprites/UI/CC_ForwardButton");
            forwardHover = MGame.Content.Load<Texture2D>("Sprites/UI/CC_ForwardButton_hover");
            forwardButton = new Button(forwardReg, forwardHover);
            forwardButton.SetPosition(new Vector2(740, 420));
            confirmationSignTexture = MGame.Content.Load<Texture2D>("Sprites/UI/CC_ConfirmationTexture");
            confirmationSprite = new StillSprite(confirmationSignTexture) { Position = new Vector2(580, 420) };
            samButtonReg = MGame.Content.Load<Texture2D>("Sprites/UI/CC_sam_sel_reg");
            samButtonHover = MGame.Content.Load<Texture2D>("Sprites/UI/CC_sam_sel_hov");
            monButtonReg = MGame.Content.Load<Texture2D>("Sprites/UI/CC_mon_sel_reg");
            monButtonHover = MGame.Content.Load<Texture2D>("Sprites/UI/CC_mon_sel_hov");
            ninButtonReg = MGame.Content.Load<Texture2D>("Sprites/UI/CC_nin_sel_reg");
            ninButtonHover = MGame.Content.Load<Texture2D>("Sprites/UI/CC_nin_sel_hov");

            showSamurai = new Button(samButtonReg, samButtonHover);
            showSamurai.SetPosition(new
                Vector2(MGame.GraphicsDevice.Viewport.Width / 4 - samButtonReg.Width / 2, 150));
            showMonk = new Button(monButtonReg, monButtonHover);
            showMonk.SetPosition(new
                Vector2(MGame.GraphicsDevice.Viewport.Width / 2 - monButtonReg.Width / 2, 150));
            showNinja = new Button(ninButtonReg, ninButtonHover);
            showNinja.SetPosition(new
                Vector2(MGame.GraphicsDevice.Viewport.Width -
                    MGame.GraphicsDevice.Viewport.Width / 4 - ninButtonReg.Width / 2, 150));

            showSamurai.EnteringSelection += PlaySound;
            showMonk.EnteringSelection += PlaySound;
            showNinja.EnteringSelection += PlaySound;
            forwardButton.EnteringSelection += PlaySound;

            classTextVector = new Vector2(300, 350);
            samuraiRep = MGame.Content.Load<Texture2D>("Sprites/playerClasses/Male_Samurai_Representation");
            monkRep = MGame.Content.Load<Texture2D>("Sprites/playerClasses/Male_Monk_Representation");
            ninjaRep = MGame.Content.Load<Texture2D>("Sprites/playerClasses/Female_Ninja_Representation");

            representation = new StillSprite(samuraiRep)
            {
                Position = new Vector2(MGame.GraphicsDevice.Viewport.Width / 4 - 60, 200)
            };

            textBackgroundTexture = MGame.Content.Load<Texture2D>("Sprites/UI/CC_text_frame");
            textBackgroundSprite = new StillSprite(textBackgroundTexture)
            {
                Position = new
                    Vector2(MGame.GraphicsDevice.Viewport.Width / 4 + samuraiRep.Width / 2 + 40, 200)
            };

            classTextVector = new
                Vector2(MGame.GraphicsDevice.Viewport.Width / 4 + samuraiRep.Width / 2 + 50, 210);

            string desc = string.Concat(
                "INITIAL STATS\n",
                "Health: {0}\n",
                "Mana: {1}\n",
                "Attack: {2}\n",
                "Armor: {3}\n",
                "Starting weapon: {4}");

            this.descriptionSam = new StringBuilder();
            this.descriptionSam.AppendLine(
                string.Format(
                    desc,
                    Samurai.DefaultSamuraiHealth,
                    Samurai.DefaultSamuraiMana,
                    Samurai.DefaultSamuraiArmor,
                    Samurai.DefaultSamuraiDamage,
                    "One-handed sword"));

            this.descriptionMon = new StringBuilder();
            this.descriptionMon.AppendLine(
               string.Format(
                   desc,
                   Monk.DefaultMonkHealth,
                   Monk.DefaultMonkMana,
                   Monk.DefaultMonkArmor,
                   Monk.DefaultMonkDamage,
                   "Staff"));

            this.descriptionNin = new StringBuilder();
            this.descriptionNin.AppendLine(
               string.Format(
                   desc,
                   Ninja.DefaultNinjaHealth,
                   Ninja.DefaultNinjaMana,
                   Ninja.DefaultNinjaArmor,
                   Ninja.DefaultNinjaDamage,
                   "One-handed dagger"));

            currentClass = CharacterType.Samurai;
            showSamurai.IsSelected = true;

            nameLabelTexture = MGame.Content.Load<Texture2D>("Sprites/UI/CC_NameLabel");
            nameLabel = new StillSprite(nameLabelTexture) { Position = new Vector2(20, 405) };
            nameInputTexture = MGame.Content.Load<Texture2D>("Sprites/UI/CC_name_input");
            nameInputTextbox = new TextBox(nameInputTexture, font);
            nameInputTextbox.SetPosition(new Vector2(107, 400));
            typedText = "";
            input = new KeyboardInput(nameInputTextbox);
        }
Exemple #5
0
        protected override void LoadContent()
        {
            mBackground = new Background(1);
            var mainMenuBackground = MGame.Content.Load<Texture2D>("Sprites/Backgrounds/MainMenuBackground");
            startTextureRegular = MGame.Content.Load<Texture2D>("Sprites/UI/MainMenu_StartButtonRegular");
            startTextureHover = MGame.Content.Load<Texture2D>("Sprites/UI/MainMenu_StartButtonHover");
            loadTextureRegular = MGame.Content.Load<Texture2D>("Sprites/UI/MainMenu_LoadButtonRegular");
            loadTextureHover = MGame.Content.Load<Texture2D>("Sprites/UI/MainMenu_LoadButtonHover");
            exitTextureRegular = MGame.Content.Load<Texture2D>("Sprites/UI/MainMenu_ExitButtonRegular");
            exitTextureHover = MGame.Content.Load<Texture2D>("Sprites/UI/MainMenu_ExitButtonHover");
            startButton = new Button(startTextureRegular, startTextureHover);
            loadButton = new Button(loadTextureRegular, loadTextureHover);
            exitButton = new Button(exitTextureRegular, exitTextureHover);
            startButton.SetPosition(new Vector2(MGame.GraphicsDevice.Viewport.Width/2-startTextureRegular.Width/2, 200));
            loadButton.SetPosition(new Vector2(MGame.GraphicsDevice.Viewport.Width / 2 - loadTextureRegular.Width / 2, 250));
            exitButton.SetPosition(new Vector2(MGame.GraphicsDevice.Viewport.Width / 2 - exitTextureRegular.Width / 2, 300));
            mBackground.Load(MGame.GraphicsDevice, mainMenuBackground);

            startButton.EnteringSelection += PlaySound;
            loadButton.EnteringSelection += PlaySound;
            exitButton.EnteringSelection += PlaySound;
        }