public bool Collisions(ref clsHUDBank Hud, ref clsChatBoxBank TextMenus, ref clsPlayer Player, int Map, ref clsArchitecture Collider, ref clsBlockingBank Blocks, ref clsNPCBank NPC, ref clsController Controller, ref clsKeyboard KBoard) { HideAll(); SetMap(Map); for (int i = 0; i < Trees.Length; i++) { if (Trees[i].Collide(Player)) { if (Trees[i].Visible) { Collider = Trees[i]; return true; } } } for (int i = 0; i < Buildings.Length; i++) { if (Player.Sprite.Collides(Buildings[i].Body)) { if (Buildings[i].Visible) { Collider = Buildings[i]; return true; } } } for (int i = 0; i < Mudhuts.Length; i++) { if (Player.Sprite.Collides(Mudhuts[i].Body)) { if (Mudhuts[i].Visible) { Collider = Mudhuts[i]; return true; } } } if (Player.Sprite.Collides(Tower.Body)) { if (Tower.Visible) { Collider = Tower; if (Controller.A || KBoard.ACCESS) { if (Player.GetQuest()==0) { if (Player.IsCollected(3)) { { Tower.Body.frame = new Vector2(0, 0); Tower.Head.frame = new Vector2(0, 0); Player.ManipulateScore(150); Player.Collectables = 0; Player.StartQuest(1); TextMenus.RadioMessage.SetText("Great work Jim! Now we can\nfinally get started. First, you\nneed to go to a village just\nnorth of your current location.\nThere is a distinct lack of\neducation in correct water\nsanitation, we have to sort\nthat out.\n\nAdditionally, collect as many\nresources as you can. You\ncan't take on challenges if\nyou don't have resources.\nYou can build resources by\nhelping out the local island\npeople."); Hud.DataBank.SetText(2, "Clean Water in 1st World"); TextMenus.Collectables.Closed(); TextMenus.Databank.ShowIndicator(); Blocks.hVillageblock[0].MakeHidden(); Blocks.hVillageblock[1].MakeHidden(); } } } TextMenus.RadioMessage.ShowIndicator(); } if (!Controller.A && !KBoard.ACCESS) { TextMenus.A.Open(); } return true; } } return false; }
public void GetSelected(ref clsChatBoxBank TextMenus, ref bool ButtonPressed, ref clsPlayer Player, ref clsArchitectureBank Architecture, ref clsBlockingBank Blocking, ref clsNPCBank NPC, ref clsBackground Background) { if (MainMenu.Visible) { switch (MainMenu.GetSelected()) { case 0: MainMenu.Hide(); Background.SetMap(8); Blocking.TowerPieces[0].OverWriteVisible = false; Blocking.TowerPieces[1].OverWriteVisible = false; Blocking.TowerPieces[2].OverWriteVisible = false; for (int i = 0; i < NPC.NPCS.Length; i++ ) NPC.NPCS[i].Sprite.Collided = false; for (int i = 0; i < Blocking.RockBlock.Length; i++) Blocking.RockBlock[i].OverWriteVisible = false; for (int i = 0; i < Blocking.hVillageblock.Length; i++) Blocking.hVillageblock[i].OverWriteVisible = false; Architecture.Tower.Body.frame = new Vector2(1, 0); Architecture.Tower.Head.frame = new Vector2(1, 0); for (int i = 0; i < Blocking.WarpPoints.Length; i++) Blocking.WarpPoints[i].OverWriteVisible = false; NPC.NPCS[1].SetSpeech("My job is to make sure nobody gets into this village because of the disease.\n What's that? A relief worker? Until I can talk to your boss on the radio, you can't come in."); NPC.NPCS[2].SetSpeech("Fix the tower you say? It looks pretty demolished if you ask me..."); DataBank.SetText(0, "A Pandemic"); for (int i = 1; i < 18; i++) DataBank.SetText(i, "No Data Yet"); Player.Sprite.position = new Vector2(300,220); Player.ResetScore(); Player.EndQuests(); TextMenus.Letter.Open(); TextMenus.Letter.SetText("Hey Jim,\n\nWe have been having reports that a large outbreak of cholera has\nemerged in the area marked on your map. You are the closest\nguy we have out there, so I'm counting on you to help out the\nlocals. First things, first though. I have been told that you have\nto fix the island's radio tower as the local geology messes\nwith our usual lines of communication. Try asking the locals if you\nget lost.\n\nGood luck, we're all counting on you back home.\n\nRegards, Steve"); TextMenus.RadioMessage.SetText("In this box will be your\ncurrent objective. As you\nhave not yet fixed the radio\ntower, all you will recieve is\nstatic. Fix the radio tower\nto recieve objectives."); TextMenus.Databank.SetText(""); TextMenus.RadioMessage.ShowIndicator(); TextMenus.Databank.ShowIndicator(); Player.ClearCollected(); break; case 1: Options.Show(); MainMenu.Hide(); Options.Selected = 0; break; case 2: ButtonPressed = false; AreYouSure[0].Show(); MainMenu.Hide(); break; } } if (AreYouSure[0].Visible) { if (ButtonPressed) { switch (AreYouSure[0].GetSelected()) { case 0: MainMenu.Show(); MainMenu.Selected = 0; AreYouSure[0].Hide(); break; } } } if (Options.Visible) { switch (Options.GetSelected()) { case 0: break; case 1: ButtonPressed = false; Options.Hide(); Credits.Show(); Credits.Selected = 3; break; case 2: MainMenu.Show(); Options.Hide(); break; } } if (StartMenu.Visible) { switch (StartMenu.GetSelected()) { case 0: StartMenu.Hide(); break; case 1: StartMenu.Hide(); AreYouSure[1].Show(); ButtonPressed = false; break; } } if (AreYouSure[1].Visible) { if (ButtonPressed) { switch (AreYouSure[1].GetSelected()) { case 0: StartMenu.Show(); StartMenu.Selected = 0; AreYouSure[1].Hide(); break; case 1: MainMenu.Show(); Background.SetMap(-1); MainMenu.Selected = 0; AreYouSure[1].Hide(); break; } } } if (AreYouSure[2].Visible) { if (ButtonPressed) { switch (AreYouSure[2].GetSelected()) { case 0: AreYouSure[2].Hide(); break; case 1: AreYouSure[2].Hide(); Player.Sprite.position = new Vector2(400, 500); Background.SetMap(21); break; } } } if (AreYouSure[3].Visible) { if (ButtonPressed) { switch (AreYouSure[3].GetSelected()) { case 0: AreYouSure[3].Hide(); break; case 1: AreYouSure[3].Hide(); Player.Sprite.position = new Vector2(400, 350); Background.SetMap(5); break; } } } if (AreYouSure[4].Visible) { if (ButtonPressed) { switch (AreYouSure[4].GetSelected()) { case 0: AreYouSure[4].Hide(); break; case 1: AreYouSure[4].Hide(); Player.Sprite.position = new Vector2(400, 500); Background.SetMap(22); break; } } } if (AreYouSure[5].Visible) { if (ButtonPressed) { switch (AreYouSure[5].GetSelected()) { case 0: AreYouSure[5].Hide(); break; case 1: AreYouSure[5].Hide(); Player.Sprite.position = new Vector2(100, 280); Background.SetMap(2); break; } } } if (AreYouSure[6].Visible) { if (ButtonPressed) { switch (AreYouSure[6].GetSelected()) { case 0: AreYouSure[6].Hide(); break; case 1: AreYouSure[6].Hide(); Player.Sprite.position = new Vector2(400, 500); Background.SetMap(23); break; } } } if (AreYouSure[7].Visible) { if (ButtonPressed) { switch (AreYouSure[7].GetSelected()) { case 0: AreYouSure[7].Hide(); break; case 1: AreYouSure[7].Hide(); Player.Sprite.position = new Vector2(150, 300); Background.SetMap(7); break; } } } if (AreYouSure[8].Visible) { if (ButtonPressed) { switch (AreYouSure[8].GetSelected()) { case 0: AreYouSure[8].Hide(); break; case 1: AreYouSure[8].Hide(); Player.Sprite.position = new Vector2(400, 400); Background.SetMap(20); Player.ClearCollected(); break; } } } if (Credits.Visible) { if (ButtonPressed) { ButtonPressed = false; Options.Selected = 0; Options.Show(); Credits.Hide(); } } if (DataBank.Visible) { if (DataBank.Text[DataBank.GetSelected()] == "No Data Yet") { TextMenus.DataPopup.SetText("We have no data for this yet."); TextMenus.DataPopup.Open(); } else { switch (DataBank.GetSelected()) { case 0: TextMenus.DataPopup.SetText("Since 1817, there have been\nseven worldwide cholera\npandemics.In Asia, Africa, and\nLatin America, there is an ongoing\npandemic that has spanned the\nlast four decades."); TextMenus.DataPopup.Open(); break; case 1: TextMenus.DataPopup.SetText("Cholera remains a problem in\nalmost every developing country."); TextMenus.DataPopup.Open(); break; case 2: TextMenus.DataPopup.SetText("Because of advanced water\nand sanitation systems, cholera is\nnot a major threat in the United\nStates. However, everyone,\nespecially travelers, should be\naware of how cholera is\ntransmitted and what can be\ndone to prevent it."); TextMenus.DataPopup.Open(); break; case 3: TextMenus.DataPopup.SetText("Mixing raw vegetables with meats\nis called cross contamination.\nBacteria from the meat enters \nthe salad. The salad would not be\ncooked to a high enough\ntemperature for the bacteria to be\ndestroyed."); TextMenus.DataPopup.Open(); break; case 4: TextMenus.DataPopup.SetText("There are obvious benefits to\nteaching. Related to cholera, the\nunderstanding of identifying,\nbeing aware of and preventing\nthe spread of such a disease\nwould be transferrable when\nthese children become parents\nthemselves."); TextMenus.DataPopup.Open(); break; case 5: TextMenus.DataPopup.SetText("Cholera transmission typically\noccurs by drinking water or\neating food that is contaminated\nwith Vibrio cholerae."); TextMenus.DataPopup.Open(); break; case 6: TextMenus.DataPopup.SetText("Assistance, such as money, food,\nor shelter, given to the needy,\naged, or victims of disaster. It is\nusually granted on a temporary\nbasis."); TextMenus.DataPopup.Open(); break; case 7: TextMenus.DataPopup.SetText("Sanitary measures are put into\nplace to prevent infection from\noccuring, not to cure oneself of it."); TextMenus.DataPopup.Open(); break; case 8: TextMenus.DataPopup.SetText("A total of 236 896 cases were\nreported in 2006, an overall\nincrease of 79% compared with\nthe number of cases reported in\n2005."); TextMenus.DataPopup.Open(); break; case 9: TextMenus.DataPopup.SetText("Most bacteria are destroyed\nwhen meat reaches a certain\ntemperature. In order to make\nmeat safe to eat, you have to\ncook it thoroughly."); TextMenus.DataPopup.Open(); break; case 10: TextMenus.DataPopup.SetText("Neither vaccination, quarantine,\nnor travel restrictions prevent\ncholera from spreading."); TextMenus.DataPopup.Open(); break; case 11: TextMenus.DataPopup.SetText("Cholera usually occurs after a\nnatural disaster such as a flood.\nThe disaster itself can displace\nfamilies and cause much confusion."); TextMenus.DataPopup.Open(); break; case 12: TextMenus.DataPopup.SetText("By having a shared pot of food\nthat anyone has access to,\ncholera outbreaks can arise\nsignificantly."); TextMenus.DataPopup.Open(); break; case 13: TextMenus.DataPopup.SetText("Cholera initially causes severe\ndehydration. This is what kills\nmost people."); TextMenus.DataPopup.Open(); break; case 14: TextMenus.DataPopup.SetText("Even if you are from a place which\ndoesn't usually suffer an outbreak,\ncholera can still hurt you."); TextMenus.DataPopup.Open(); break; case 15: TextMenus.DataPopup.SetText("75% of cholera sufferers do\nnot exibit any symptoms."); TextMenus.DataPopup.Open(); break; case 16: TextMenus.DataPopup.SetText("Cholera is caused by eating\ncontaminated foodstuffs.\nTransmission is primarily due to\nthe fecal contamination of food\nand water due to poor sanitation.\nThis bacterium can, however,\nlive naturally in any environment."); TextMenus.DataPopup.Open(); break; case 17: TextMenus.DataPopup.SetText("Cholera will never be fully cured..."); TextMenus.DataPopup.Open(); break; } } } if (AreYouSure[9].Visible) { if (ButtonPressed) { switch (AreYouSure[9].GetSelected()) { case 0: AreYouSure[9].Hide(); break; case 1: AreYouSure[9].Hide(); Player.Sprite.position = new Vector2(540, 260); Background.SetMap(24); Player.ClearCollected(); Player.StartQuest(1); ButtonPressed = false; Player.ClearCorrect(); TeachGame[0].Show(); Player.Sprite.frame = new Vector2(3, 5); Player.FlipPlayer(true); break; } } } if (AreYouSure[10].Visible) { if (ButtonPressed) { switch (AreYouSure[10].GetSelected()) { case 0: AreYouSure[10].Hide(); break; case 1: AreYouSure[10].Hide(); Player.Sprite.position = new Vector2(400, 400); Background.SetMap(25); Player.ClearCollected(); Player.StartQuest(2); ButtonPressed = false; Player.ClearCorrect(); FoodGame[0].Show(); Player.Sprite.frame = new Vector2(0, 2); break; } } } if (TeachGame[0].Visible) { if (ButtonPressed) { switch (TeachGame[0].GetSelected()) { case 0: TeachGame[1].Show(); TeachGame[0].Hide(); Player.AddCorrect(); ButtonPressed = false; break; case 1: TeachGame[1].Show(); TeachGame[0].Hide(); ButtonPressed = false; break; case 2: TeachGame[1].Show(); TeachGame[0].Hide(); ButtonPressed = false; break; } } } if (TeachGame[1].Visible) { if (ButtonPressed) { switch (TeachGame[1].GetSelected()) { case 0: TeachGame[1].Hide(); TeachGame[2].Show(); ButtonPressed = false; break; case 1: TeachGame[1].Hide(); TeachGame[2].Show(); Player.AddCorrect(); ButtonPressed = false; break; case 2: TeachGame[1].Hide(); TeachGame[2].Show(); ButtonPressed = false; break; } } } if (TeachGame[2].Visible) { if (ButtonPressed) { switch (TeachGame[2].GetSelected()) { case 0: TeachGame[2].Hide(); TeachGame[3].Show(); Player.AddCorrect(); ButtonPressed = false; break; case 1: TeachGame[2].Hide(); TeachGame[3].Show(); ButtonPressed = false; break; case 2: TeachGame[2].Hide(); TeachGame[3].Show(); ButtonPressed = false; break; } } } if (TeachGame[3].Visible) { if (ButtonPressed) { switch (TeachGame[3].GetSelected()) { case 0: TeachGame[3].Hide(); TeachGame[4].Show(); ButtonPressed = false; break; case 1: TeachGame[3].Hide(); TeachGame[4].Show(); Player.AddCorrect(); ButtonPressed = false; break; case 2: TeachGame[3].Hide(); TeachGame[4].Show(); ButtonPressed = false; break; } } } if (TeachGame[4].Visible) { if (ButtonPressed) { switch (TeachGame[4].GetSelected()) { case 0: TeachGame[4].Hide(); Player.Sprite.position = new Vector2(400, 270); Background.SetMap(21); ButtonPressed = false; break; case 1: TeachGame[4].Hide(); Player.Sprite.position = new Vector2(400, 270); Background.SetMap(21); ButtonPressed = false; break; case 2: TeachGame[4].Hide(); Player.AddCorrect(); Player.Sprite.position = new Vector2(400, 270); Background.SetMap(21); ButtonPressed = false; break; } switch (Player.GetCorrect()) { case 0: case 1: TextMenus.RadioMessage.SetText("Oh dear, I'm not sure what\nhappened there. You gave\nquite a few wrong messages.\nYou will have to try again\nbefore I can give you the\nnext mission."); break; case 2: TextMenus.RadioMessage.SetText("You scored 2 out of 5.\nIt's not quite good enough to\nlet you proceed to the next\nmission. You will have to try\nagain."); break; case 3: case 4: TextMenus.RadioMessage.SetText("Almost there, you just missed\nout on a few vital points.\nTry again."); break; case 5: TextMenus.RadioMessage.SetText("Excellent work. \nTo the village north-east of\nthis location, there is a\nserious problem with food\nsanitation. Go show 'em\nwhat to do!"); Player.ManipulateScore(150); Blocking.WarpPoints[7].MakeHidden(); for(int i=0; i<6; i++) Blocking.RockBlock[i].MakeHidden(); DataBank.SetText(4, "Those Who Can..."); TextMenus.RadioMessage.ShowIndicator(); TextMenus.Databank.ShowIndicator(); Player.StartQuest(2); break; } TextMenus.RadioMessage.ShowIndicator(); } } if (FoodGame[0].Visible) { Player.Sprite.frame = new Vector2(3, 0); if (ButtonPressed) { switch (FoodGame[0].GetSelected()) { case 0: FoodGame[1].Show(); FoodGame[0].Hide(); Player.AddCorrect(); ButtonPressed = false; break; case 1: FoodGame[1].Show(); FoodGame[0].Hide(); ButtonPressed = false; break; } } } if (FoodGame[1].Visible) { Player.Sprite.frame = new Vector2(3, 0); if (ButtonPressed) { switch (FoodGame[1].GetSelected()) { case 0: FoodGame[1].Hide(); FoodGame[2].Show(); ButtonPressed = false; break; case 1: FoodGame[1].Hide(); FoodGame[2].Show(); Player.AddCorrect(); ButtonPressed = false; break; } } } if (FoodGame[2].Visible) { Player.Sprite.frame = new Vector2(3, 0); if (ButtonPressed) { switch (FoodGame[2].GetSelected()) { case 0: FoodGame[2].Hide(); FoodGame[3].Show(); Player.AddCorrect(); ButtonPressed = false; break; case 1: FoodGame[2].Hide(); FoodGame[3].Show(); ButtonPressed = false; break; } } } if (FoodGame[3].Visible) { Player.Sprite.frame = new Vector2(3, 0); if (ButtonPressed) { switch (FoodGame[3].GetSelected()) { case 0: FoodGame[3].Hide(); FoodGame[4].Show(); ButtonPressed = false; break; case 1: FoodGame[3].Hide(); FoodGame[4].Show(); Player.AddCorrect(); ButtonPressed = false; break; } } } if (FoodGame[4].Visible) { Player.Sprite.frame = new Vector2(3, 0); if (ButtonPressed) { switch (FoodGame[4].GetSelected()) { case 0: FoodGame[4].Hide(); Player.Sprite.position = new Vector2(150, 250); Player.AddCorrect(); Background.SetMap(22); ButtonPressed = false; break; case 1: FoodGame[4].Hide(); Player.Sprite.position = new Vector2(150, 250); Background.SetMap(22); ButtonPressed = false; break; } switch (Player.GetCorrect()) { case 0: case 1: TextMenus.RadioMessage.SetText("Oh dear, I'm not sure what\nhappened there. You gave\nquite a few wrong messages.\nYou will have to try again\nbefore I can give you the\nnext mission."); break; case 2: TextMenus.RadioMessage.SetText("You scored 2 out of 5.\nIt's not quite good enough to\nlet you proceed to the next\nmission. You will have to try\nagain."); break; case 3: case 4: TextMenus.RadioMessage.SetText("Almost there, you just missed\nout on a few vital points.\nTry again."); break; case 5: TextMenus.RadioMessage.SetText("Excellent work. The third\nvillage is to the east of this\nlocation, you need to use the\nresources you have obtained\nto sanitise their drinking\nwater from the well."); Player.ManipulateScore(150); Blocking.WarpPoints[8].MakeHidden(); for (int i = 6; i < 18; i++) Blocking.RockBlock[i].MakeHidden(); DataBank.SetText(16, "Nom Nom"); TextMenus.RadioMessage.ShowIndicator(); TextMenus.Databank.ShowIndicator(); Player.StartQuest(3); TextMenus.Collectables.Open(); break; } TextMenus.RadioMessage.ShowIndicator(); } } }
public bool Collisions(ref clsPlayer Player, ref clsHUDBank HUD, int Map, ref clsBlocking Collider, ref clsChatBoxBank TextMenus, ref clsBackground Background) { HideAll(); SetMap(Map); for (int i = 0; i < 2; i++) { if (hVillageblock[i].Collide(Player)) { if (hVillageblock[i].Visible) { Collider = hVillageblock[i]; return true; } } } if (School.Collide(Player)) { if (School.Visible) { Collider = School; return true; } } for (int i = 0; i < 3; i++) { if (TowerPieces[i].Collide(Player)) { if (TowerPieces[i].Visible) { TowerPieces[i].MakeHidden(); Player.AddCollectable(); Collider = TowerPieces[i]; return true; } } } for (int i = 0; i < Blank.Length; i++) { if (Blank[i].Collide(Player)) { if (Blank[i].Visible) { Collider = Blank[i]; return true; } } } for (int i = 0; i < RockBlock.Length; i++) { if (RockBlock[i].Collide(Player)) { if (RockBlock[i].Visible) { Collider = RockBlock[i]; return true; } } } for (int i = 0; i < Bacteria.Length; i++) { if (Bacteria[i].Visible) { if (Bacteria[i].Collide(Player)) { Collider = Bacteria[i]; Player.AddCollectable(); Player.ManipulateScore(10); Bacteria[i].MakeHidden(); if (Bacteria[0].OverWriteVisible && Bacteria[1].OverWriteVisible && Bacteria[2].OverWriteVisible && Bacteria[3].OverWriteVisible && Bacteria[4].OverWriteVisible && Bacteria[5].OverWriteVisible && Bacteria[6].OverWriteVisible && Bacteria[7].OverWriteVisible && Bacteria[8].OverWriteVisible && Bacteria[9].OverWriteVisible && Bacteria[10].OverWriteVisible && Bacteria[11].OverWriteVisible && Bacteria[12].OverWriteVisible && Bacteria[13].OverWriteVisible && Bacteria[14].OverWriteVisible) { Player.EndQuests(); TextMenus.Collectables.Closed(); Background.SetMap(23); Player.Sprite.position = new Vector2(200, 290); HUD.DataBank.SetText(17, "To Be Continued"); TextMenus.RadioMessage.SetText("You have completed the\ngame! Check the databank to\ngo over what you have\nlearned."); TextMenus.RadioMessage.ShowIndicator(); } return true; } } } for (int i = 0; i < 6; i++) { if (WarpPoints[i].Visible) { if (WarpPoints[i].Collide(Player)) { HUD.AreYouSure[i + 2].Show(); return true; } } } if (WarpPoints[6].Visible) { if (WarpPoints[6].Collide(Player)) { if (Player.GetScore() >= 580) { HUD.AreYouSure[8].Show(); } else { TextMenus.RadioMessage.SetText("You need 580 resources to\nclean the well water."); TextMenus.RadioMessage.ShowIndicator(); } return true; } } if (WarpPoints[7].Visible) { if (WarpPoints[7].Collide(Player)) { if (Player.GetScore() >= 190) { HUD.AreYouSure[9].Show(); } else { TextMenus.RadioMessage.SetText("You need 190 resources to\nteach the children. Try talking\nwith local people."); TextMenus.RadioMessage.ShowIndicator(); } return true; } } if (WarpPoints[8].Visible) { if (WarpPoints[8].Collide(Player)) { if (Player.GetScore() >= 360) { HUD.AreYouSure[10].Show(); } else { TextMenus.RadioMessage.SetText("You need 360 resources to\n teach these people. Sorry."); TextMenus.RadioMessage.ShowIndicator(); } return true; } } for (int i = 9; i < WarpPoints.Length; i++) { if (WarpPoints[i].Visible) { if (WarpPoints[i].Collide(Player)) { HUD.AreYouSure[i + 2].Show(); return true; } } } if (Boat.Visible) { if (Boat.Collide(Player)) { return true; } } return false; }
protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); RadioFont = Content.Load<SpriteFont>("RadioBox"); Sprites = new clsSpriteBank(Content); TextMenus = new clsChatBoxBank(ref Sprites, ref RadioFont); NPC = new clsNPCBank(Content, ref Sprites); Environmentals = new clsArchitectureBank(Content, ref Sprites); Blocks = new clsBlockingBank(Content, ref Sprites); Hud = new clsHUDBank(ref Sprites, ref RadioFont); Player = new clsPlayer(Sprites.sprPlayer, 5, 15); Background = new clsBackground(Sprites.sprBackground); soundBank.PlayCue("Music"); }