Exemplo n.º 1
0
        public void Update(GameTime gameTime, Area area, Player player)
        {
            MouseState mouse = Mouse.GetState();
            difference = "Difference: (" + area.difference.X.ToString() + ", " + area.difference.Y.ToString() + ")";
            smallDifference = "Small Difference: (" + area.smallDifference.X.ToString() + ", " + area.smallDifference.Y.ToString() + ")";
            areaAtZero = "Area(x,y) at (0,0): " + area.area[0, 0, 0].ToString();
            if (area.colliding)
            {
                colliding = "Colliding with Object: True";
            }
            else
            {
                colliding = "Colliding with Object: False";
            }
            //playerBounds = "Player Bounds:\nX: " + player.bounds.X + "\nY: " + player.bounds.Y + "\nWidth/Height: " + player.bounds.Width;
            mousePos = "Mouse Position = " + mouse.X + ", " + mouse.Y;

            X = ((mouse.X + 86) / 16) - 1;
            Y = ((mouse.Y + 86) / 16) - 1;

            selectedTile = "" + X + ", " + Y;

            inventory = "";
            for (int x = 0; x < 3; x++)
            {
                inventory += player.Inv[x, 0] + ", " + player.Inv[x,1];
                inventory += "\n";
            }
            invSlot = "Slot: " + player.selectedInvSlot;
        }
Exemplo n.º 2
0
 public void Draw(SpriteBatch spriteBatch, Player player)
 {
     spriteBatch.Draw(healthPotion[healthBarIndex], healthBarPos, Color.White);
     if (Global.displayInv)
     {
         Global.displayBook = false;
         spriteBatch.Draw(inventoryBackground, inventoryPos, Color.White);
         for (int x = 0; x < 18; x++)
         {
             if (player.Inv[x, 0] != 0)
             {
                 if (player.Inv[x, 0] < 100)
                 {
                     if (x < 4)
                     {
                         spriteBatch.Draw(items[player.Inv[x, 0]], new Rectangle((int)itemCoordsInv[x].X + 20, (int)itemCoordsInv[x].Y, 80, 80), Color.White);
                     }
                     else
                     {
                         spriteBatch.Draw(items[player.Inv[x, 0]], new Rectangle((int)itemCoordsInv[x].X + 20, (int)itemCoordsInv[x].Y, 52, 52), Color.White);
                     }
                     spriteBatch.DrawString(Global.font, player.Inv[x, 1].ToString(), new Vector2(itemCoordsInv[x].X + 25, itemCoordsInv[x].Y + 5), Color.White);
                 }
                 else
                 {
                     if (x < 4)
                     {
                         spriteBatch.Draw(equipment[player.Inv[x, 0] - 100], new Rectangle((int)itemCoordsInv[x].X + 20, (int)itemCoordsInv[x].Y, 80, 80), Color.White);
                     }
                     else
                     {
                         spriteBatch.Draw(equipment[player.Inv[x, 0] - 100], new Rectangle((int)itemCoordsInv[x].X + 20, (int)itemCoordsInv[x].Y, 52, 52), Color.White);
                     }
                     spriteBatch.DrawString(Global.font, player.Inv[x, 1].ToString(), new Vector2(itemCoordsInv[x].X + 25, itemCoordsInv[x].Y + 5), Color.White);
                 }
             }
         }
         //spriteBatch.Draw(items[hoverTexture], new Vector2(Global.GetMouse().X, Global.GetMouse().Y),
         if (Global.hover && hoverTexture != null)
         {
             Rectangle mouse = new Rectangle(Global.GetMouse().X, Global.GetMouse().Y, 42, 42);
             spriteBatch.Draw(hoverTexture, mouse, Color.White);
         }
     }
 }
Exemplo n.º 3
0
 public void Update(Player player, Area area)
 {
     this.player = player;
     this.area = area;
 }
Exemplo n.º 4
0
 // index 0 = sky
 // 1 = dirt1
 // 2 = dirt2
 // 3 = dirt3
 // 4 = stone1
 // 5 = stone2
 // 6 = stone3
 //List<Texture2D> textures = new List<Texture2D>();
 public World(Player player, Area area)
 {
     this.player = player;
     this.area = area;// GenerateWorld(genPasses);
 }
Exemplo n.º 5
0
        public void BlockModifier(string situation, Player player, GameTime gameTime)
        {
            bool dig = false;
            digTimer += gameTime.ElapsedGameTime.TotalSeconds;
            if (digTimer < .5 && digTimer > 0)
            {
                digIndex = 0;
            }
            else if(digTimer < 1.0 && digTimer > .5)
            {
                digIndex = 1;
            }
            else if (digTimer < 1.5 && digTimer > 1.0)
            {
                digIndex = 2;
            }
            else if (digTimer < 2 && digTimer > 1.5)
            {
                digIndex = 3;
                dig = true;
            }

            Random random = new Random();
            int MouseCordX;
            int MouseCordY;
            MouseState mouse = Mouse.GetState();

            //Vector2 mouseDistance; // calculate distance from player's center
            //mouseDistance.X = Math.Abs(mouse.X - (player.playerPosition.X + 16));
            //mouseDistance.Y = Math.Abs(mouse.Y - (player.playerPosition.Y + 24));

            //MouseCordX = (((mouse.X + 86) - (int)(smallDifference.X * 16f)) / 16);
            //MouseCordY = (((mouse.Y + 86) - (int)(smallDifference.Y * 16f)) / 16);
            Vector2 MouseCord = MouseCoord();
            digLocation = new Vector2(MouseCord.X, MouseCord.Y);

            if (dig || situation == "Add")
            {
                //int BlockID = 1; // temprorary hardcoded value
                int BlockID = 0;
                // prevents the player from placing/removing blocks that are far away
                if (MouseInRange())
                {
                    switch (situation)
                    {
                        case "Delete":
                            digTimer = 0;
                            digLocation.X = -1;
                            digLocation.Y = -1;
                            // 28, 21
                            BlockID = MouseIndex();
                            player.InvAdd(BlockID);
                            Global.world[(int)(MouseCord.X + difference.X), (int)(MouseCord.Y + difference.Y), 0] = 0;
                            break;
                        case "Add":
                            BlockID = player.Inv[player.selectedInvSlot, 0];
                            if (BlockID != 0)
                            {
                                if (player.InvDel(BlockID) && area[(int)MouseCord.X, (int)MouseCord.Y, 0] == 0)
                                {
                                    if ((BlockID == 1))//Dirt
                                    {
                                        BlockID = random.Next(1, 4);
                                    }
                                    else if (BlockID == 4)
                                    {
                                        BlockID = random.Next(4, 7);
                                    }
                                    Global.world[(int)(MouseCord.X + difference.X), (int)(MouseCord.Y + difference.Y), 0] = BlockID;
                                }
                            }
                            break;
                    }
                }
            }
        }
Exemplo n.º 6
0
        public void Update(GameTime gameTime, Player player)
        {
            // smooth movement
            #region Smooth Movement
            if (smallDifference.X >= 1)
            {
                difference.X--;
                smallDifference.X = (float)(1f / Global.ScreenWidth);
            }
            if (smallDifference.Y >= 1)
            {
                difference.Y--;
                smallDifference.Y = (float)(1f / Global.ScreenHeight);
            }
            if (smallDifference.X <= 0)
            {
                difference.X++;
                smallDifference.X = (float)((Global.ScreenWidth - 1f) / Global.ScreenWidth);
            }
            if (smallDifference.Y <= 0)
            {
                difference.Y++;
                smallDifference.Y = (float)((Global.ScreenHeight - 1f) / Global.ScreenHeight);
            }
            #endregion
            for (int y = 0; y < 45; y++)
            {
                for (int x = 0; x < 60; x++)
                {
                    if (x + difference.X <= Global.SIZE_X && x + difference.X > 0 && y + difference.Y <= Global.SIZE_Y && y + difference.Y > 0)
                    {
                        area[x, y, 0] = Global.world[x + (int)difference.X, y + (int)difference.Y, 0]; // update the index
                    }
                    else
                    {
                        area[x, y, 0] = -1; // if edge, blank space
                    }
                    /*try
                    {

                    } // try
                    catch
                    {
                        area[x, y, 0] = -1; // if edge, blank space
                    } // catch*/
                } // for x
            } // for y

            // collision detection
            Rectangle playerBounds = new Rectangle(397, 328, 6, 1);
            bool ground = Collision(playerBounds, player);

            playerBounds = new Rectangle(390, 280, 1, 30);
            bool left = Collision(playerBounds, player);

            playerBounds = new Rectangle(405, 280, 1, 34);
            bool right = Collision(playerBounds, player);

            playerBounds = new Rectangle(397, 281, 6, 1);
            bool top = Collision(playerBounds, player);

            if (ground)
            {
                colliding = true;
                player.isFalling = false;
            }
            else
            {
                colliding = false;
                player.isFalling = true;
            }
            if (left)
            {
                player.canMoveLeft = false;
            }
            else
            {
                player.canMoveLeft = true;
            }
            if (right)
            {
                player.canMoveRight = false;
            }
            else
            {
                player.canMoveRight = true;
            }
            if (top)
            {
                player.jumpTimer = 0;
            }
        }
Exemplo n.º 7
0
 public bool Collision(Rectangle playerBounds, Player player)
 {
     // collision detection
      //   if (!Global.debugMode)
      //   {
         Rectangle blockBounds;
         for (int y = 19; y < 26; y++)
         {
             for (int x = 24; x < 33; x++)
             {
                 blockBounds = new Rectangle((-86 + ((x) * 16) + (int)(smallDifference.X * (float)16)), -86 + (y * 16), 16, 16);
                 if (area[x, y, 0] != 0)
                 {
                     if (playerBounds.Intersects(blockBounds))
                     {
                         return true;
                     }
                     else
                     {
                         continue;
                     }
                 }
             }
         }
         return false;
      //   }
     return false;
 }
Exemplo n.º 8
0
        public void Update(GameTime gameTime, Player player)
        {
            Global.displayInv = false;

            page1 = CheckInvSlots(recipes[page, 0].requirements, player.Inv);
            page2 = CheckInvSlots(recipes[page, 1].requirements, player.Inv);
        }
Exemplo n.º 9
0
        public void CreateSlot2(Player player)
        {
            bool first = false;
            bool second = false;
            if (page2)
            {
                for (int x = 0; x < 18; x++)
                {
                    if (player.Inv[x, 0] == recipes[page, 1].requirements[0, 0] && player.Inv[x, 1] >= recipes[page, 1].requirements[0, 1] && !first)
                    {
                        first = true;

                    }
                    else
                    {
                        first = false;
                    }
                    if (player.Inv[x, 0] == recipes[page, 1].requirements[1, 0] && player.Inv[x, 1] >= recipes[page, 1].requirements[1, 1])
                    {
                        second = true;
                        break;
                    }
                    else
                    {
                        second = false;
                    }
                }
                if (first && second)
                {
                    for (int num = recipes[page, 1].requirements[0, 1]; num > 0; num--)
                    {
                        player.InvDel(recipes[page, 1].requirements[0, 0]);
                    }
                    for (int num = recipes[page, 1].requirements[1, 1]; num > 0; num--)
                    {
                        player.InvDel(recipes[page, 1].requirements[1, 0]);
                    }

                    player.InvAddItem(recipes[page, 1].itemIndex);
                }
            }
        }
Exemplo n.º 10
0
        protected override void LoadContent()
        {
            #region Global Items
            // creates a new sprite drawer
            spriteBatch = new SpriteBatch(GraphicsDevice);
            Global.font = Content.Load<SpriteFont>("UI\\Arial"); // loads font for text
            Global.bigFont = Content.Load<SpriteFont>("UI\\Arial Big");
            debug = new Debug(); // creates a new debug object
            Global.grid = Content.Load<Texture2D>("UI\\Grid"); // saves the grid texture into global
            #endregion
            #region Main Menu Items
            txCreareTitle = Content.Load<Texture2D>("UI\\CreareTitle"); // texture for the main title picutre
            // texture and hover textures for buttons used on the main menu
            Texture2D txBtnNew = Content.Load<Texture2D>("Temp Buttons\\BtnNew");
            Texture2D txBtnNewHover = Content.Load<Texture2D>("Temp Buttons\\BtnNewHover");
            Texture2D txBtnLoad = Content.Load<Texture2D>("Temp Buttons\\BtnLoad");
            Texture2D txBtnLoadHover = Content.Load<Texture2D>("Temp Buttons\\BtnLoadHover");
            Texture2D txBtnExit = Content.Load<Texture2D>("Temp Buttons\\BtnExit");
            Texture2D txBtnExitHover = Content.Load<Texture2D>("Temp Buttons\\BtnExitHover");
            // create the 3 menu buttons and position them
            Button btnNew = new Button(txBtnNew, txBtnNewHover, txBtnNew, new Vector2(350, 400));
            Button btnLoad = new Button(txBtnLoad, txBtnLoadHover, txBtnLoad, new Vector2(350, 450));
            Button btnExit = new Button(txBtnExit, txBtnExitHover, txBtnExit, new Vector2(350, 500));
            // add the button event for when it is clicked
            btnNew.OnPress += new EventHandler(btnNew_OnPress);
            btnLoad.OnPress += new EventHandler(btnLoad_OnPress);
            btnExit.OnPress += new EventHandler(btnExit_OnPress);
            // add the buttons to a list of main menu buttons
            mainMenuButtons.Add(btnNew);
            mainMenuButtons.Add(btnLoad);
            mainMenuButtons.Add(btnExit);
            #endregion
            #region World Select Items

            txDeleteAlert = Content.Load<Texture2D>("UI\\Delete");

            Texture2D txBtnWorld1 = Content.Load<Texture2D>("Temp Buttons\\BtnWorld1");
            Texture2D txBtnWorld1Hover = Content.Load<Texture2D>("Temp Buttons\\BtnWorld1Hover");
            Texture2D txBtnWorld2 = Content.Load<Texture2D>("Temp Buttons\\BtnWorld2");
            Texture2D txBtnWorld2Hover = Content.Load<Texture2D>("Temp Buttons\\BtnWorld2Hover");
            Texture2D txBtnWorld3 = Content.Load<Texture2D>("Temp Buttons\\BtnWorld3");
            Texture2D txBtnWorld3Hover = Content.Load<Texture2D>("Temp Buttons\\BtnWorld3Hover");
            Texture2D txBtnWorld4 = Content.Load<Texture2D>("Temp Buttons\\BtnWorld4");
            Texture2D txBtnWorld4Hover = Content.Load<Texture2D>("Temp Buttons\\BtnWorld4Hover");
            Texture2D txBtnWorld5 = Content.Load<Texture2D>("Temp Buttons\\BtnWorld5");
            Texture2D txBtnWorld5Hover = Content.Load<Texture2D>("Temp Buttons\\BtnWorld5Hover");

            Texture2D txBtnBack = Content.Load<Texture2D>("Temp Buttons\\BtnBack");
            Texture2D txBtnBackHover = Content.Load<Texture2D>("Temp Buttons\\BtnBackHover");
            Texture2D txBtnDelete = Content.Load<Texture2D>("Temp Buttons\\BtnDelete");
            Texture2D txBtnDeleteHover = Content.Load<Texture2D>("Temp Buttons\\BtnDeleteHover");
            Texture2D txBtnGO = Content.Load<Texture2D>("Temp Buttons\\BtnGO");
            Texture2D txBtnGOHover = Content.Load<Texture2D>("Temp Buttons\\BtnGOHover");

            Button btnWorld1 = new Button(txBtnWorld1, txBtnWorld1Hover, txBtnWorld1, new Vector2(130, 300));
            Button btnWorld2 = new Button(txBtnWorld2, txBtnWorld2Hover, txBtnWorld2, new Vector2(240, 300));
            Button btnWorld3 = new Button(txBtnWorld3, txBtnWorld3Hover, txBtnWorld3, new Vector2(350, 300));
            Button btnWorld4 = new Button(txBtnWorld4, txBtnWorld4Hover, txBtnWorld4, new Vector2(460, 300));
            Button btnWorld5 = new Button(txBtnWorld5, txBtnWorld5Hover, txBtnWorld5, new Vector2(570, 300));

            Button btnDelete = new Button(txBtnDelete, txBtnDeleteHover, txBtnDelete, new Vector2(240, 500));
            Button btnBack = new Button(txBtnBack, txBtnBackHover, txBtnBack, new Vector2(460, 500));
            Button btnGO = new Button(txBtnGO, txBtnGOHover, txBtnGO, new Vector2(350, 500));

            btnWorld1.OnPress += new EventHandler(btnWorld1_OnPress);
            btnWorld2.OnPress += new EventHandler(btnWorld2_OnPress);
            btnWorld3.OnPress += new EventHandler(btnWorld3_OnPress);
            btnWorld4.OnPress += new EventHandler(btnWorld4_OnPress);
            btnWorld5.OnPress += new EventHandler(btnWorld5_OnPress);

            btnBack.OnPress += new EventHandler(btnBack_OnPress);
            btnDelete.OnPress += new EventHandler(btnDelete_OnPress);
            btnGO.OnPress += new EventHandler(btnGO_OnPress);

            worldSelectButtons.Add(btnWorld1);
            worldSelectButtons.Add(btnWorld2);
            worldSelectButtons.Add(btnWorld3);
            worldSelectButtons.Add(btnWorld4);
            worldSelectButtons.Add(btnWorld5);
            worldSelectButtons.Add(btnBack);
            worldSelectButtons.Add(btnDelete);
            worldSelectButtons.Add(btnGO);
            #endregion
            #region Play Items
            // sequence of textures to play when the player is walking on the ground
            Texture2D[] txPlayer = new Texture2D[6]
            {
                Content.Load<Texture2D>("Player\\Image10000"),
                Content.Load<Texture2D>("Player\\Image10001"),
                Content.Load<Texture2D>("Player\\Image10002"),
                Content.Load<Texture2D>("Player\\Image10003"),
                Content.Load<Texture2D>("Player\\Image10004"),
                Content.Load<Texture2D>("Player\\Image10005"),
            };
            Texture2D blank = Content.Load<Texture2D>("Terrain\\Void"); // blank texture for display if the world is null or out of boudns
            Texture2D PlayerFall = Content.Load<Texture2D>("Player\\player falling"); // playertexture when in the air

            // sequence of textures to play when the player digs a block
            List<Texture2D> digTextures = new List<Texture2D>()
            {
                Content.Load<Texture2D>("UI\\Dig1"),
                Content.Load<Texture2D>("UI\\Dig2"),
                Content.Load<Texture2D>("UI\\Dig3"),
                Content.Load<Texture2D>("UI\\Dig4"),
            };
            area = new Area(blank, digTextures); // stores the indexes and information related to movement and block modification
            // array of textures for the player's health status
            Texture2D[] healthPotion = new Texture2D[3]
            {
                Content.Load<Texture2D>("UI\\HealthPotion Empty"),
                Content.Load<Texture2D>("UI\\HealthPotion Half"),
                Content.Load<Texture2D>("UI\\HealthPotion Full")
            };
            // overlay for the crafting book
            Texture2D craftingBook = Content.Load<Texture2D>("UI\\Book");
            // overlay for the inventory
            Texture2D inventoryBackground = Content.Load<Texture2D>("UI\\Invitory Screen");

            Texture2D miniBook = Content.Load<Texture2D>("UI\\MiniBook"); // texture of the book
            Texture2D miniBookHover = Content.Load<Texture2D>("UI\\MiniBookHover"); // texture of the book when you over over it
            Texture2D miniInv = Content.Load<Texture2D>("UI\\MiniInv"); // texture for inventory when it's not on the overlay mode
            Texture2D txBtnSaveAndExit = Content.Load<Texture2D>("UI\\BtnSaveAndExit");
            Texture2D btnCreate = Content.Load<Texture2D>("Temp Buttons\\Create Button"); // texture of the book when you over over it
            Texture2D btnCreate2 = Content.Load<Texture2D>("Temp Buttons\\Create Button"); // texture of the book when you over over it
            Texture2D txBtnBookExit = Content.Load<Texture2D>("Temp Buttons\\BookExit");
            Texture2D txBtnBookExitHover = Content.Load<Texture2D>("Temp Buttons\\BookExitHover");
            Texture2D btnCreateHover = Content.Load<Texture2D>("Temp Buttons\\Create Button Hover"); // texture for inventory when it's not on the overlay mode
            Texture2D txBtnArrowLeft = Content.Load<Texture2D>("UI\\BookArrow");
            Texture2D txBtnArrowRight = Content.Load<Texture2D>("UI\\BookArrowRight");

            Button btnBook = new Button(miniBook, miniBookHover, miniBook, new Vector2(135, 5)); // crafting book button
            btnBookCreate = new Button(btnCreate,btnCreateHover,btnCreate, new Vector2(45,515));
            btnBookCreate2 = new Button(btnCreate2, btnCreateHover, btnCreate, new Vector2(470, 515));
            btnBookExit = new Button(txBtnBookExit, txBtnBookExitHover, txBtnBookExit, new Vector2(765, 10));
            Button btnMiniInv = new Button(miniInv, miniInv, miniInv, new Vector2(0, 5)); // inventory button
            btnSaveAndExit = new Button(txBtnSaveAndExit, txBtnSaveAndExit, txBtnSaveAndExit, new Vector2(675, 550));
            btnArrowLeft = new Button(txBtnArrowLeft,txBtnArrowLeft,txBtnArrowLeft,new Vector2(20,275));
            btnArrowRight = new Button(txBtnArrowRight,txBtnArrowRight,txBtnArrowRight,new Vector2(675,275));

            btnBook.OnPress += new EventHandler(btnBook_OnPress); // event handlers for buttons
            btnMiniInv.OnPress += new EventHandler(btnMiniInv_OnPress);
            btnSaveAndExit.OnPress +=new EventHandler(btnSaveAndExit_OnPress);
            btnBookCreate.OnPress += new EventHandler(btnBookCreate_OnPress); // event handlers for buttons
            btnBookCreate2.OnPress += new EventHandler(btnBookCreate2_OnPress); // event handlers for buttons
            btnBookExit.OnPress += new EventHandler(btnBookExit_OnPress);
            btnArrowLeft.OnPress +=new EventHandler(btnArrowLeft_OnPress);
            btnArrowRight.OnPress +=new EventHandler(btnArrowRight_OnPress);
            playButtons.Add(btnBook); // added to the list of play screen buttons
            playButtons.Add(btnMiniInv); // added to the list of play screen buttons
            //playButtons.Add(btnSaveAndExit); // not to be added to play nuttons because it has special features

            Texture2D verticalGrass = Content.Load<Texture2D>("Terrain\\HorsGrass"); // horizontal grass
            Texture2D horizontalGrass = Content.Load<Texture2D>("Terrain\\Grass"); // vertical grass

            // add the loaded textures to the list of grass textures
            area.AddGrassVariety(verticalGrass);
            area.AddGrassVariety(horizontalGrass);

            Texture2D sky = Content.Load<Texture2D>("Terrain\\Sky"); // blue sky
            Texture2D dirt1 = Content.Load<Texture2D>("Terrain\\Dirt1"); // dirt varieties
            Texture2D dirt2 = Content.Load<Texture2D>("Terrain\\Dirt2");
            Texture2D dirt3 = Content.Load<Texture2D>("Terrain\\Dirt3");
            Texture2D stone1 = Content.Load<Texture2D>("Terrain\\Stone1"); // stone varieties
            Texture2D stone2 = Content.Load<Texture2D>("Terrain\\Stone2");
            Texture2D stone3 = Content.Load<Texture2D>("Terrain\\Stone3");
            Texture2D CopperOre = Content.Load<Texture2D>("Terrain\\CopperOre"); // copper ore
            Texture2D IronOre = Content.Load<Texture2D>("Terrain\\IronOre"); // iron ore
            Texture2D SilverOre = Content.Load<Texture2D>("Terrain\\SilverOre"); // silver ore
            Texture2D GoldOre = Content.Load<Texture2D>("Terrain\\GoldOre"); // gold ore
            Texture2D Trunk = Content.Load<Texture2D>("Terrain\\Trunk"); // tree trunk wood
            Texture2D Leaves = Content.Load<Texture2D>("Terrain\\Leaves"); // leaves
            // add loaded textures to the list saved in area
            area.AddTexture(sky); // 0
            area.AddTexture(dirt1); // 1
            area.AddTexture(dirt2); // 2
            area.AddTexture(dirt3); // 3
            area.AddTexture(stone1); // 4
            area.AddTexture(stone2); // 5
            area.AddTexture(stone3); // 6
            area.AddTexture(CopperOre); // 7
            area.AddTexture(IronOre); // 8
            area.AddTexture(SilverOre); //9
            area.AddTexture(GoldOre); //10
            area.AddTexture(Trunk); //11
            area.AddTexture(Leaves); //12

            Texture2D CaveBackGround = Content.Load<Texture2D>("Terrain\\CaveBackground");
            area.AddBackground(sky); // 0
            area.AddBackground(CaveBackGround); // 1

            // player equipment
            List<Texture2D> equipment = new List<Texture2D>()
            {
                Content.Load<Texture2D>("Equipment\\Copper Pickaxe"), // 0
                Content.Load<Texture2D>("Equipment\\Copper Axe"), // 1
                Content.Load<Texture2D>("Equipment\\Iron Pickaxe"), // 2
                Content.Load<Texture2D>("Equipment\\Iron Axe"), // 3
                Content.Load<Texture2D>("Equipment\\Steel Pickaxe"), // 4
                Content.Load<Texture2D>("Equipment\\Steel Axe"), // 5
                Content.Load<Texture2D>("Equipment\\Silver Pickaxe"), // 6
                Content.Load<Texture2D>("Equipment\\Silver Axe"), // 7
                Content.Load<Texture2D>("Equipment\\Gold Pickaxe"), // 8
                Content.Load<Texture2D>("Equipment\\Gold Axe"), // 9
            };
            // stores the information used to display and utilize the user interface when playing
            ui = new UI(healthPotion, inventoryBackground, equipment);
            player = new Player(txPlayer, PlayerFall, equipment);

            List<Texture2D> items = new List<Texture2D>();

            items.Add(Content.Load<Texture2D>("UI\\Items\\BTDirt")); // 0 not used
            items.Add(Content.Load<Texture2D>("UI\\Items\\BTDirt")); // 1
            items.Add(Content.Load<Texture2D>("UI\\Items\\BTDirt")); // 2 not used
            items.Add(Content.Load<Texture2D>("UI\\Items\\BTDirt")); // 3 not used
            items.Add(Content.Load<Texture2D>("UI\\Items\\BTStone")); // 4
            items.Add(Content.Load<Texture2D>("UI\\Items\\BTStone")); // 5 not used
            items.Add(Content.Load<Texture2D>("UI\\Items\\BTStone")); // 6 not used
            items.Add(Content.Load<Texture2D>("UI\\Items\\BTCopper")); // 7
            items.Add(Content.Load<Texture2D>("UI\\Items\\BTIron")); // 8
            items.Add(Content.Load<Texture2D>("UI\\Items\\BTSilver")); // 9
            items.Add(Content.Load<Texture2D>("UI\\Items\\BTGold")); // 10
            items.Add(Content.Load<Texture2D>("UI\\Items\\BTWood")); // 11
            items.Add(Content.Load<Texture2D>("UI\\Items\\BTSteel")); // 12

            List<Texture2D> itemsGray = new List<Texture2D>();

            items.Add(Content.Load<Texture2D>("UI\\Items\\BTDirt")); // 0 not used
            items.Add(Content.Load<Texture2D>("UI\\Items\\BTDirt")); // 1
            items.Add(Content.Load<Texture2D>("UI\\Items\\BTDirt")); // 2 not used
            items.Add(Content.Load<Texture2D>("UI\\Items\\BTDirt")); // 3 not used
            items.Add(Content.Load<Texture2D>("UI\\Items Gray\\BTStone-Grayed")); // 4
            items.Add(Content.Load<Texture2D>("UI\\Items\\BTStone")); // 5 not used
            items.Add(Content.Load<Texture2D>("UI\\Items\\BTStone")); // 6 not used
            items.Add(Content.Load<Texture2D>("UI\\Items Gray\\BTCopperGray")); // 7
            items.Add(Content.Load<Texture2D>("UI\\Items Gray\\BTIronGray")); // 8
            items.Add(Content.Load<Texture2D>("UI\\Items Gray\\BTSilver Gray")); // 9
            items.Add(Content.Load<Texture2D>("UI\\Items Gray\\BTGold Gray")); // 10
            items.Add(Content.Load<Texture2D>("UI\\Items Gray\\BTSteel Gray")); // 11

            // add items to the user interface
            ui.AddItemTextures(items);
            // add grayed items to the user interface
            ui.AddItemGrayTextures(itemsGray);
            #endregion
            // stores the world creation, saving, and loading systems
            world = new World(player, area);
            // list of selected slot textures based on which slot is selected
            List<Texture2D> miniInvSlots = new List<Texture2D>()
            {
                Content.Load<Texture2D>("MiniInvTop"),
                Content.Load<Texture2D>("MiniInvRight"),
                Content.Load<Texture2D>("MiniInvBot"),
                Content.Load<Texture2D>("MiniInvLeftt"),
            };
            // send the array to the player
            player.AddMiniInv(miniInvSlots);

            crafting = new Crafting(craftingBook, items, itemsGray, equipment);
        }
Exemplo n.º 11
0
 public void Update(GameTime gameTime, Player player)
 {
 }