/// <summary> /// Load visual/audio content for this screen /// </summary> public override void LoadContent() { content = ScreenManager.Game.Content; blank = content.Load<Texture2D>("blank"); powerBar = content.Load<Texture2D>("gamePlayScreen/HUD/health_bar1"); txBackground = content.Load<Texture2D>("Shop/store"); txCursor = content.Load<Texture2D>("Shop/hand point"); mouseCursor = content.Load<Texture2D>("Cursor"); blackout = new Texture2D(ScreenManager.GraphicsDevice, 1, 1, false, SurfaceFormat.Color); blackout.SetData<UInt32>(new UInt32[]{0xAA333333}); clerk = new Sprite(content.Load<Texture2D>("Shop/Clerk"), new Vector2(237, 261), new Vector2(0,0)); voucher = new Sprite(content.Load<Texture2D>("Shop/Receipt"), new Vector2(1, 1), new Vector2(0, 0)); shopHUD = new miniHUD(blank, powerBar, new Rectangle(160, 20, 532, 100)); shopBLUR = new blur(ScreenManager.GraphicsDevice.Viewport.Width, ScreenManager.GraphicsDevice.Viewport.Height, new Vector2(0, 0), ScreenManager.GraphicsDevice, Player.VISUALS.stat[0], Player.VISUALS.stat[1]); //******************************************************************************* //*Buyables must be added in the order they appear in the enumerated "items" type //******************************************************************************* #region Generate Buyables List //Bread shopItems.Add(new Buyable(new Vector2(795, 362), content.Load<Texture2D>("Shop/breadUP"), content.Load<Texture2D>("Shop/breadMO"), content.Load<Texture2D>("Shop/breadDN"), 2.49m, 0.50f, 0.50f, "$2.49 - Bread", "Yum\n++Energy -Intoxication")); //Alcohol shopItems.Add(new Buyable(new Vector2(235, 690), content.Load<Texture2D>("Shop/alcoholUP"), content.Load<Texture2D>("Shop/alcoholMO"), content.Load<Texture2D>("Shop/alcoholDN"), 2.34m, 0.18f, 0.18f, "$2.34 - Alcohol", "Bottoms up!\n+Intoxication")); //Cigarettes shopItems.Add(new Buyable(new Vector2(425, 379), content.Load<Texture2D>("Shop/smokesUP"), content.Load<Texture2D>("Shop/smokesMO"), content.Load<Texture2D>("Shop/smokesDN"), 4.50m, 1.00f, 1.00f, "$4.50 - Cigarettes", "Smoke 'em if ya got 'em\n+Odor")); //Lotto ticket shopItems.Add(new Buyable(new Vector2(1120, 418), content.Load<Texture2D>("Shop/lottoTicketUP"), content.Load<Texture2D>("Shop/lottoTicketMO"), content.Load<Texture2D>("Shop/lottoTicketDN"), 1.00m, 0.50f, 0.50f, "$1.00 - Lottery Ticket", "Gotta spend money to make money\n+Energy +Extra cash (low chance)")); //Soap shopItems.Add(new Buyable(new Vector2(775, 421), content.Load<Texture2D>("Shop/soapUP"), content.Load<Texture2D>("Shop/soapMO"), content.Load<Texture2D>("Shop/soapDN"), .79m, 0.15f, 0.15f, "$0.79 - Soap", "Take a bum shower\n--Odor")); //Garbage bags shopItems.Add(new Buyable(new Vector2(10, 655), content.Load<Texture2D>("Shop/trashBagsUP"), content.Load<Texture2D>("Shop/trashBagsMO"), content.Load<Texture2D>("Shop/trashBagsDN"), 1.99m, 0.17f, 0.17f, "$1.99 - Trash Bags", "Increase your carrying capacity\n+Carrying capacity")); //Harass the clerk shopItems.Add(new Buyable(new Vector2(144, 250), content.Load<Texture2D>("Shop/harassUP"), content.Load<Texture2D>("Shop/harassMO"), content.Load<Texture2D>("Shop/harassDN"), 0m, 1.00f, 1.00f, "Harass the clerk...", "You think you're better than me!?\nSuccess: +Energy +Wanted level\nFailure: -Energy")); //Steal crackers shopItems.Add(new Buyable(new Vector2(442, 243), content.Load<Texture2D>("Shop/crackersUP"), content.Load<Texture2D>("Shop/crackersMO"), content.Load<Texture2D>("Shop/crackersDN"), 0m, 1.00f, 1.00f, "Attempt to steal some crackers...", "Get in meh belly!\nSuccess: +Energy \n-Intoxication")); //Steal cart shopItems.Add(new Buyable(new Vector2(747, 236), content.Load<Texture2D>("Shop/cartUP"), content.Load<Texture2D>("Shop/cartMO"), content.Load<Texture2D>("Shop/cartDN"), 0m, 1.00f, 1.00f, "Attempt to steal a shopping cart...", "This thing holds a lotta cans!\nSuccess: Max carrying capacity\n(Don't get caught!)")); //Exit shopItems.Add(new Buyable(new Vector2(1105, 93), content.Load<Texture2D>("Shop/exitUP"), content.Load<Texture2D>("Shop/exitMO"), content.Load<Texture2D>("Shop/exitDN"), 0m, 0.50f, 0.50f, "Exit shop", "Return more bottles and cans")); #endregion fntTitle = ScreenManager.Font[(int)ScreenManager.fontStyle.game14B]; fntInfo = ScreenManager.Font[(int)ScreenManager.fontStyle.shopinfo12I]; if (ScreenManager.GlobalOptions.SOUND_ENABLE) { musicBG = ScreenManager.ShopMusic; if (MediaPlayer.State != MediaState.Playing) { MediaPlayer.Play(musicBG); } } Mouse.WindowHandle = base.ScreenManager.Game.Window.Handle; }
/// <summary> /// Load graphics content for the game. /// </summary> public override void LoadContent() { // Should speed up load times: content = ScreenManager.Game.Content; //Load Fonts gameFont = ScreenManager.Font[(int)ScreenManager.fontStyle.game14B]; //Load Sounds //Load Content for HUD powerBar1 = content.Load<Texture2D>("gamePlayScreen/HUD/health_bar1"); powerBar2 = content.Load<Texture2D>("gamePlayScreen/HUD/health_bar2"); powerBar3 = content.Load<Texture2D>("gamePlayScreen/HUD/health_bar3"); smallBeer = content.Load<Texture2D>("gamePlayScreen/HUD/corona"); paperBag = content.Load<Texture2D>("gamePlayScreen/HUD/paperBag"); trashBag = content.Load<Texture2D>("gamePlayScreen/HUD/trashBag"); cart = content.Load<Texture2D>("gamePlayScreen/HUD/cart"); HUDbackground1 = content.Load<Texture2D>("gamePlayScreen/HUD/horizontalBar"); HUDbackground2 = content.Load<Texture2D>("gamePlayScreen/HUD/verticalBar"); HUD = new gameplayHUD(HUDbackground1, HUDbackground2, powerBar1, powerBar2, powerBar3, smallBeer, Player.face, paperBag, trashBag, cart, gameFont, ScreenManager.GlobalOptions.SCREEN_WIDTH, ScreenManager.GlobalOptions.SCREEN_HEIGHT, Player); //Load Content for Mouse, Cursor, and Hands mouseCursor = content.Load<Texture2D>("cursor"); input.Viewport = new Rectangle(0, 0, ScreenManager.GraphicsDevice.Viewport.Width, ScreenManager.GraphicsDevice.Viewport.Height); // Create a debug texture for the mouses hitbox. blue = new Texture2D(ScreenManager.MyDevice, mouseCursor.Width, mouseCursor.Height, false, SurfaceFormat.Color); Int32[] toSet = new Int32[mouseCursor.Width * mouseCursor.Height]; for (int i = 0; i < (mouseCursor.Width * mouseCursor.Height); i++) { // Cornflower blue. toSet[i] = 0x6495ED; } blue.SetData<Int32>(toSet); hand_empty = content.Load<Texture2D>("gamePlayScreen/Hands/hand-point"); hand_glass = content.Load<Texture2D>("gamePlayScreen/Hands/hand-glass"); hand_plastic = content.Load<Texture2D>("gamePlayScreen/Hands/hand-plastic"); hand_can = content.Load<Texture2D>("gamePlayScreen/Hands/hand-can"); handPosition1 = new Vector2(input.Mouse.X, input.Mouse.Y); handPosition2 = new Vector2(input.Mouse.X, input.Mouse.Y); HAND = new playerHand(hand_empty, handPosition1); HAND2 = new playerHand(hand_empty, handPosition2); //Load Content for BLUR Visuals BLUR = new blur(1040, 580, new Vector2(0, 70), ScreenManager.GraphicsDevice, Player.VISUALS.stat[0], Player.VISUALS.stat[1]); //Load Content for Machines bottleCompoBG = new bottleBackground(3, new Vector2((int)(base.ScreenManager.GlobalOptions.SCREEN_WIDTH * backgroundScale), (int)(base.ScreenManager.GlobalOptions.SCREEN_HEIGHT * backgroundScale))); bottleCompoBG.Load(this.content, ScreenManager.MyDevice, false); bottleCompoBG_fade = new bottleBackground(bottleCompoBG); bottleCompoBG_fade.Load(this.content, ScreenManager.MyDevice, true); //Create button(s) btnShop = new Button(new Vector2(1060, 675), content.Load<Texture2D>("gamePlayScreen/shopButton"), content.Load<Texture2D>("gamePlayScreen/shopButtonMO"), content.Load<Texture2D>("gamePlayScreen/shopButton")); btnShop.Hide(); ScreenManager.Game.ResetElapsedTime(); Mouse.WindowHandle = base.ScreenManager.Game.Window.Handle; input.Viewport = new Rectangle(0, 0, ScreenManager.GraphicsDevice.Viewport.Width, ScreenManager.GraphicsDevice.Viewport.Height); }