Exemplo n.º 1
0
        /// <summary>
        /// Draws the world map to the screen
        /// </summary>
        /// <param name="obj">used to draw to the screen</param>
        /// <param name="highLight">highlights an object on the screen if the mouse is hovering over it</param>
        /// <param name="openClose">Lets us know if the player stats menu is open or closed</param>
        public void WorldMap(SpriteBatch obj, Color highLight, bool openClose, GameStats gstats, SpriteFont outer)
        {
            // sets world map to the size of the screen
            Rectangle WorldMapTextureRec = new Rectangle(0, 0, obj.GraphicsDevice.Viewport.Width, obj.GraphicsDevice.Viewport.Height);



            // sets the button for the player stat
            if (tracker == 0)
            {
                Rectangle inOutButtonRec = new Rectangle(0, (obj.GraphicsDevice.Viewport.Height / 2) - 28, 30, 56);
                Rectangle steelRec       = new Rectangle(-150, 0, 150, obj.GraphicsDevice.Viewport.Height); //-150



                box3 = inOutButtonRec;
                box4 = steelRec;

                tracker += 1;
            }

            Rectangle faceRec = new Rectangle((box4.Width / 5) + box4.X, 30, 80, 80);                                             //150

            Rectangle levelRec    = new Rectangle((box4.Width / 12) + box4.X, 170, 130, 30);                                      //150
            Rectangle levelBarRec = new Rectangle(levelRec.X + 10, levelRec.Y + 7, (int)(110 * (gstats.LevelExp / 100)), 15);     //150

            Rectangle infamyRec    = new Rectangle((box4.Width / 12) + box4.X, 270, 130, 30);                                     //150
            Rectangle infamyBarRec = new Rectangle(infamyRec.X + 10, infamyRec.Y + 7, (int)(110 * (gstats.InfamyExp / 100)), 15); //150

            Rectangle moneyRec = new Rectangle((box4.Width / 12) + box4.X, 390, 130, 70);                                         //150

            //OLD CODE
            //Rectangle ContractPinRec = new Rectangle(200, 110, 10, 10);


            // Draws the world map
            obj.Draw(worldMapTexture, WorldMapTextureRec, Color.White);


            // Draws the player stats if the button is pressed
            if (openClose == false)
            {
                obj.Draw(steel, box4, Color.White);

                obj.Draw(startButton, faceRec, Color.White);
                obj.Draw(startButton, levelRec, Color.White);
                obj.Draw(healthBlock, levelBarRec, Color.White);
                obj.Draw(startButton, infamyRec, Color.White);
                obj.Draw(healthBlock, infamyBarRec, Color.Red);
                obj.Draw(startButton, moneyRec, Color.White);

                obj.DrawString(outer, "LVL:" + gstats.Level, new Vector2((int)levelRec.X + 10, (int)levelRec.Y - 30), Color.White);
                obj.DrawString(outer, "INFAMY:" + gstats.Infamy, new Vector2((int)infamyRec.X, (int)infamyRec.Y - 30), Color.White);
                obj.DrawString(outer, " BANK\nACCOUNT:", new Vector2((int)moneyRec.X, (int)moneyRec.Y - 60), Color.White);
                obj.DrawString(outer, "$" + gstats.Money, new Vector2((int)moneyRec.X + 5, (int)moneyRec.Y + 20), Color.Gold);

                obj.Draw(outButton, box3, highLight);
            }
            else if (openClose == true)
            {
                obj.Draw(steel, box4, Color.White);

                obj.Draw(startButton, faceRec, Color.White);
                obj.Draw(startButton, levelRec, Color.White);
                obj.Draw(healthBlock, levelBarRec, Color.White);
                obj.Draw(startButton, infamyRec, Color.White);
                obj.Draw(healthBlock, infamyBarRec, Color.Red);
                obj.Draw(startButton, moneyRec, Color.White);

                obj.DrawString(outer, "LVL:" + gstats.Level, new Vector2((int)levelRec.X + 10, (int)levelRec.Y - 30), Color.White);
                obj.DrawString(outer, "INFAMY:" + gstats.Infamy, new Vector2((int)infamyRec.X, (int)infamyRec.Y - 30), Color.White);
                obj.DrawString(outer, " BANK\nACCOUNT:", new Vector2((int)moneyRec.X, (int)moneyRec.Y - 60), Color.White);
                obj.DrawString(outer, "$" + gstats.Money, new Vector2((int)moneyRec.X + 5, (int)moneyRec.Y + 20), Color.Gold);

                obj.Draw(inButton, box3, highLight);
            }

            //OLD CODE
            //box1 = ContractPinRec;
            //obj.Draw(contractPin, ContractPinRec, Color.White);
        }
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()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            // Testing Player Load
            p1                = new Player1(GraphicsDevice.Viewport.Width / 2 - 125, GraphicsDevice.Viewport.Height - 175, 125, 125, 3, 2, 1);
            gstats            = new GameStats(100000, 5, 30, 90.0, 50.0);
            spriteSheet       = Content.Load <Texture2D>("spriteSheetB.png");
            testImage         = Content.Load <Texture2D>("Pizza.png");
            p1.CurrentTexture = testImage;

            // Loading in all the menu textures
            #region Menu Textures

            startButton        = Content.Load <Texture2D>("basicButton.png");
            yesButton          = Content.Load <Texture2D>("basicButton.png");
            noButton           = Content.Load <Texture2D>("basicButton.png");
            worldMapTexture    = Content.Load <Texture2D>("WorldMap.jpg");
            contractPin        = Content.Load <Texture2D>("RedPin.png");
            contractMenu       = Content.Load <Texture2D>("MenuBackground.png");
            contractItem       = Content.Load <Texture2D>("Item1.jpg");
            contractExitButton = Content.Load <Texture2D>("ExitButton.png");
            buyButton          = Content.Load <Texture2D>("basicButton.png");
            continueButton     = Content.Load <Texture2D>("basicButton.png");
            abortButton        = Content.Load <Texture2D>("basicButton.png");
            inButton           = Content.Load <Texture2D>("InButton.jpg");
            outButton          = Content.Load <Texture2D>("OutButton.jpg");
            steel       = Content.Load <Texture2D>("steel.jpg");
            text        = Content.Load <SpriteFont>("SimplifiedArabicFixed_14");
            desText     = Content.Load <SpriteFont>("SimplifiedArabicFixed_10");
            priceText   = Content.Load <SpriteFont>("SimplifiedArabicFixed_22");
            faceGui     = Content.Load <Texture2D>("guiFace.png");
            healthBlock = Content.Load <Texture2D>("health block.png");
            #endregion

            //Loading in all the items
            items    = new List <Item> [3];
            itemsLv1 = new List <Item>();
            itemsLv2 = new List <Item>();
            itemsLv3 = new List <Item>();

            monaLisa = new MonaLisa(Content.Load <Texture2D>("Item1.jpg"));
            dog      = new Dog(Content.Load <Texture2D>("Dog.jpg"));
            doc      = new Documents(Content.Load <Texture2D>("documents.jpg"));
            knyfe    = new knife(Content.Load <Texture2D>("Knife.jpg "));

            itemsLv1.Add(dog);
            itemsLv1.Add(knyfe);
            itemsLv2.Add(doc);
            itemsLv3.Add(monaLisa);

            items[0] = itemsLv1;
            items[1] = itemsLv2;
            items[2] = itemsLv3;

            mis      = null;
            numOfMis = 39;

            // plugging textures into the Game Menu Class
            GMenus = new GameMenus(startButton, yesButton, noButton, worldMapTexture, contractPin, contractMenu, contractItem, contractExitButton, buyButton, continueButton, abortButton, inButton, outButton, steel, faceGui, healthBlock);


            camPos = new Vector2(0, 0); // Setting up to pulling the camera position from the Camera class

            // Start Menu Stuff
            framesM = 10;
            letter  = 0;
            end     = false;
            title   = "Stealing\nThe\nMona\nLisa";


            tileA = Content.Load <Texture2D>("tileA.png");
            tileB = Content.Load <Texture2D>("tileB.png");
            tileC = Content.Load <Texture2D>("tileC.png");

            textTile();

            //enemy textures
            enemy1.CurrentTexture = testImage;
            enemy2.CurrentTexture = testImage;

            tileRect  = new List <Rectangle>();
            tempRects = new List <tileClass>();

            foreach (tileClass t in rects)
            {
                rect = t.HitBox;
                tileRect.Add(rect);
            }
        }