Exemplo n.º 1
0
        //Setup menu background
        public ui setupMenu(int backgroundX, int backgroundY, int backgroundWidth, int backgroundHeight)
        {
            ui menuBkg = new ui();

            menuBkg.rectangle.X = backgroundX;
            menuBkg.rectangle.Y = backgroundY + backgroundHeight;
            menuBkg.rectangle = new Rectangle(menuBkg.rectangle.X, menuBkg.rectangle.Y + 25, backgroundWidth, 200);
            menuBkg.drawRectangle = new Rectangle(0, 0, 900, 250);
            menuBkg.name = "menuBkg";

            return menuBkg;
        }
Exemplo n.º 2
0
        //Setup money sign before money value
        public ui setupMoneySign(int topBarX, int topBarY, int topBarHeight)
        {
            ui moneySign = new ui();

            moneySignWidth = 8;
            moneySignHeight = 12;

            moneySign.rectangle.X = topBarX + 15;
            moneySign.rectangle.Y = topBarY + ((26 - moneySignHeight) / 2);
            moneySign.rectangle = new Rectangle(moneySign.rectangle.X, moneySign.rectangle.Y, moneySignWidth, moneySignHeight);
            moneySign.name = "moneySign";

            return moneySign;
        }
Exemplo n.º 3
0
        protected override void LoadContent()
        {
            //Old mouse state
            oldMouseState = Mouse.GetState();

            //Initial selected skill **move or replace**
            skillSelected = "right";
            setSkill = 1;

            //Row and column of tiles
            tileRows = 5;
            tileColumns = 9;
            tileRowSet = false;

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

            //Fonts
            Font = Content.Load<SpriteFont>("Font");
            skillHotkeysFont = Content.Load<SpriteFont>("skillHotkeysFont");

            //Starting game status
            gameStatus = "playing";

            //Level 1
            level1 = level1.create(level1, screenWidth, screenHeight);

            //Setup UI
            menu = menu.setupMenu(level1.rectangle.X, level1.rectangle.Y, level1.bkgWidth, level1.bkgHeight);
            menu.image = Content.Load<Texture2D>("ui");

            topBar = topBar.setupTopBar(level1.rectangle.X, level1.rectangle.Y, level1.bkgWidth, level1.bkgHeight);
            topBar.image = Content.Load<Texture2D>("topBar");

            moneySign = moneySign.setupMoneySign(topBar.rectangle.X, topBar.rectangle.Y, level1.bkgWidth);
            moneySign.image = Content.Load<Texture2D>("dollarSign");
            cash.setLocation(moneySign.rectangle.X, moneySign.rectangle.Y);

            mouse.image = Content.Load<Texture2D>("arrowPointer");

            //Setup Tiles
            tiles.setupTiles(250, 10, 100, 100, screenWidth, screenHeight);
            tileArray = tiles.get();
            tiles.image = Content.Load<Texture2D>("skillOverlay");

            //Setup Skills
            setupSkills.setupSkills(menu.rectangle.X, menu.rectangle.Y, menu.rectangle.Height, menu.rectangle.Width);
            skills = setupSkills.getSkillsList();
            setupSkills.placeSkills(skills);
            chosenSkills = setupSkills.getChosenSkillsList();
            setupSkills.setupSkillHotkeys(skills);
            skillHotkeys = setupSkills.getSkillHotkeys();

            //Setup Hotkeys **change when adding user input for settings**
            setupHotkey.setupHotkeys();
            hotkeys = setupHotkey.getHotkeys();

            //Setup Skill Images
            for (int i = 0; i < chosenSkills.Count; i++)
            {
                chosenSkills[i].image = Content.Load<Texture2D>("skillButtons");
            }
        }
Exemplo n.º 4
0
        //setup topbar where money value is located
        public ui setupTopBar(int backgroundX, int backgroundY, int backgroundWidth, int backgroundHeight)
        {
            ui topBar = new ui();

            topBar.rectangle.X = backgroundX;
            topBar.rectangle.Y = backgroundY + backgroundHeight;
            topBar.rectangle = new Rectangle(topBar.rectangle.X, topBar.rectangle.Y, backgroundWidth, 25);
            topBar.name = "topBar";

            return topBar;
        }
Exemplo n.º 5
0
        //Place Skill On Tile
        public ui placeSkillOnTile(int column, int row, int skillChosen)
        {
            tileArray[column, row].skillOnTile = true;

            ui skills = new ui();
            if (row > 0)
                skills.rectangle = new Rectangle(tileArray[column, row].x + 7, tileArray[column, row].y + 10 - tileArray[column, row].height, tileArray[column, row].width - 10, tileArray[column, row].height - 10);
            else
                skills.rectangle = new Rectangle(tileArray[column, row].x, tileArray[column, row].y - tileArray[column, row].height + 11, tileArray[column, row].width - 10, tileArray[column, row].height - 10);

            skills.setDrawRectangle(skillChosen);
            skills.name = "skill";
            skillsPlacedOnBoard.Add(skills);

            return skills;
        }