예제 #1
0
 public void Update(Player p)
 {
     PlayerName.ChangeText(p.Name + "   Lvl: " + p.Level);
     PlayerHP.ChangeText("HP: " + p.CurrentHP + "/" + p.MaxHP);
     PlayerMP.ChangeText("MP: " + p.CurrentMP + "/" + p.MaxMP);
     PlayerPieces.ChangeText("Pieces: " + p.Pieces);
     PlayerPotions.ChangeText("Potions: " + p.Potions);
     PlayerXP.ChangeText("EXP: " + p.CurrentXP);
     PlayerXPNeeded.ChangeText("To Next: " + p.XPtoNext);
 }
예제 #2
0
 public HUD(ContentManager content, Player p)
 {
     PlayerPieceImage = content.Load<Texture2D>("Images/PlayerPiece");
     PlayerName = new Text(content.Load<SpriteFont>("Fonts/buttonFont"), p.Name + "   Lvl: " + p.Level, new Vector2(125, 615), Color.Blue);
     PlayerHP = new Text(content.Load<SpriteFont>("Fonts/buttonFont"), "HP: " + p.CurrentHP + "/" + p.MaxHP, new Vector2(125, 655), Color.Blue);
     PlayerMP = new Text(content.Load<SpriteFont>("Fonts/buttonFont"), "MP: " + p.CurrentMP + "/" + p.MaxMP, new Vector2(125, 685), Color.Blue);
     PlayerPieces = new Text(content.Load<SpriteFont>("Fonts/buttonFont"), "Pieces: " + p.Pieces , new Vector2(325, 655), Color.Blue);
     PlayerPotions = new Text(content.Load<SpriteFont>("Fonts/buttonFont"), "Potions: " + p.Potions, new Vector2(325, 685), Color.Blue);
     PlayerXP = new Text(content.Load<SpriteFont>("Fonts/buttonFont"), "EXP: " + p.CurrentXP, new Vector2(525, 655), Color.Blue);
     PlayerXPNeeded = new Text(content.Load<SpriteFont>("Fonts/buttonFont"), "To Next: " + p.XPtoNext, new Vector2(525, 685), Color.Blue);
 }
예제 #3
0
        protected override void LoadScreenContent(ContentManager content)
        {
            background = new Background(content, "Images/GameplayBackground");
            map = new Map[7];
            map[0] = content.Load<Map>("Maps/map01");
            map[1] = content.Load<Map>("Maps/map02");
            map[2] = content.Load<Map>("Maps/map03");
            map[3] = content.Load<Map>("Maps/map04");
            map[4] = content.Load<Map>("Maps/map05");
            map[5] = content.Load<Map>("Maps/map06");
            map[6] = content.Load<Map>("Maps/map07");
            player = new Player(content);
            player.TilePosition = new Vector2(1, 17);
            hud = new HUD(content, player);
            mapNumber = 0;
            leftButton = new Button(content, "", new Vector2(800, 650), Color.White, Color.White, "Images/LeftButton");
            rightButton = new Button(content, "", new Vector2(900, 650), Color.White, Color.White, "Images/RightButton");
            upButton = new Button(content, "", new Vector2(850, 595), Color.White, Color.White, "Images/UpButton");
            downButton = new Button(content, "", new Vector2(850, 705), Color.White, Color.White, "Images/DownButton");

            copyTileLayer = map[mapNumber].GetLayer("Layer") as TileLayer;
            tileLayer = copyTileLayer;
            blankTile = tileLayer.Tiles[19, 0];
            walkableTile = tileLayer.Tiles[19, 1];
            enemyTile = tileLayer.Tiles[19, 2];
            exitTile = tileLayer.Tiles[19, 3];
            enemykilledTile = tileLayer.Tiles[19, 4];

            for (int y = 0; y < tileLayer.Height; y++)
            {
                for (int x = 0; x < 19; x++)
                {
                    if (tileLayer.Tiles[x, y] == enemykilledTile)
                    {
                        tileLayer.Tiles[x, y] = enemyTile;
                    }
                }
            }
            attackButton = new Button(content, "Attack", new Vector2(ScreenWidth / 2 + 220, 250), Color.Blue, Color.White);
            magicButton = new Button(content, "Magic", new Vector2(ScreenWidth / 2 + 220, 325), Color.Blue, Color.White);
            potionButton = new Button(content, "Potion", new Vector2(ScreenWidth / 2 + 220, 400), Color.Blue, Color.White);
            minion = new Minion(content);
            boss = new Boss(content);
            inBattle = false;
            bossBattle = false;

            #region Pregame
            playerCreated = false;
            keydown = (char)0;
            enterplayernameText = new Text(content.Load<SpriteFont>("Fonts/buttonFont"), "Enter Characters Name:", new Vector2(350, 200));
            confirmnameButton = new Button(content, "Enter", new Vector2(425, 550), Color.Blue, Color.White);
            textenterbox = content.Load<Texture2D>("Images/TextInputBar");
            playername = new Text(content.Load<SpriteFont>("Fonts/buttonFont"),"", new Vector2(375, 400), Color.Blue);
            charAmt = 0;
            nameComplete = false;
            enteredName = new char[8];
            for (int i = 0; i < enteredName.Length; i++)
            {
                enteredName[i] = ' ';
            }
            chooseclasstext = new Text(content.Load<SpriteFont>("Fonts/buttonFont"), "Choose Characters Class:", new Vector2(340, 200));
            paladinButton = new Button(content, "Paladin", new Vector2(425, 400), Color.Blue, Color.White);
            casterButton = new Button(content, "Caster", new Vector2(425, 500), Color.Blue, Color.White);
            rogueButton = new Button(content, "Rogue", new Vector2(425, 600), Color.Blue, Color.White);
            storyContinueButton = new Button(content, "Continue", new Vector2(800, 700), Color.Blue, Color.White);
            classComplete = false;
            storytexts = new Texture2D[3];
            storyCount = 0;
            storytexts[0] = content.Load<Texture2D>("Images/Storytext1");
            storytexts[1] = content.Load<Texture2D>("Images/Storytext2");
            storytexts[2] = content.Load<Texture2D>("Images/Storytext3");
            #endregion
        }