public static void YesOrNo(Player player, Shop shop, List <Landmarks> listOfLandmarks) { string GameMenuInput = Console.ReadLine().ToLower(); if (GameMenuInput == "yes" || GameMenuInput == "y") { player.gameMenuInput = ConsoleKey.Y.ToString(); } if (GameMenuInput == "no" || GameMenuInput == "n") { player.gameMenuInput = ConsoleKey.N.ToString(); } if (GameMenuInput != "yes" && GameMenuInput != "y" && GameMenuInput != "no" && GameMenuInput != "n") { player.AtLandmark = false; player.LeavingALandmark = false; GameMenu.Message(player, listOfLandmarks); GameMenu.Status(player); YesOrNo(player, shop, listOfLandmarks); } }
public static void SpaceOrYes(Player player, Shop shop, List <Landmarks> listOfLandmarks) { Console.WriteLine(" Press SPACE BAR to continue"); ConsoleKeyInfo GameMenuInput = Console.ReadKey(); if (GameMenuInput.Key == ConsoleKey.Spacebar) { //GameMenu.ShowRiverCrossing(player); //GameMenu.PrintGameMenu(game, player, shop, listOfLandmarks); player.gameMenuInput = ""; } if (GameMenuInput.Key == ConsoleKey.Y) { ConsoleKeyInfo c = Console.ReadKey(); if (c.Key == ConsoleKey.Enter) { GameMenu.ShowRiverCrossing(player); GameMenu.PrintGameMenu(player, shop, listOfLandmarks); } } }
public static void Cycle(Player player, Shop shop, List <Landmarks> listOfLandmarks)//, Program program) { player.AtFort = false; while (player.Traveling) { if (player.InitLeg) { player.theLeg = listOfLandmarks[player.IndexForLandmarks].DistanceToNextLandmark; player.InitLeg = false; } else { if (player.theLeg <= 0) { if (listOfLandmarks[player.IndexForLandmarks + 1].Name == "Willameete Valley Oregon") { Console.Clear(); Console.WriteLine("pic of valley"); Console.WriteLine(""); Console.WriteLine(""); headerWithDate(player); InputDetection.Spacebar(player); Console.Clear(); Console.WriteLine(" Congratulations! You have"); Console.WriteLine(" made it to Oregon! Let's"); Console.WriteLine(" see how many points you have"); Console.WriteLine(" recived."); Console.WriteLine(" Willamwette Valley"); Console.WriteLine(" September 24, 1848"); InputDetection.Spacebar(player); player.Traveling = false; Score(player); break; } player.IndexForLandmarks += 1; var i = listOfLandmarks[player.IndexForLandmarks].DistanceToNextLandmark; player.MilesToNextLandmark = i; player.Landmark = listOfLandmarks[player.IndexForLandmarks].Name; player.InitLeg = true; player.ArrivingLanmark = true; player.LegMiles = player.MilesToNextLandmark; if (player.greenRiverCrossing) { player.IndexForLandmarks += 2; player.Landmark = listOfLandmarks[player.IndexForLandmarks].Name; player.greenRiverCrossing = false; } if (player.WillametteValley) { } } else { //calculates miles traveled //player.pace = player. //food consumed player.date = player.date.AddDays(1); player.poundsOfFoods -= player.teamSize * player.rations; var TempNextLandmark = player.theLeg; var tempMiles = TempNextLandmark - player.pace; if (tempMiles <= 0) { player.MilesTraveled += player.theLeg; player.theLeg = 0; } else { player.theLeg = player.theLeg - player.pace; player.MilesTraveled += player.pace; } player.AtLandmark = false; } } if (player.fortBridger) { player.IndexForLandmarks += 1; player.theLeg = listOfLandmarks[9].Distance; player.fortBridger = false; } if (player.fortWallaWalla) { //player.IndexForLandmarks += 1; player.theLeg = listOfLandmarks[14].DistanceToNextLandmark; //player.fortWallaWalla = false; } if (player.theDalles) { player.IndexForLandmarks += 1; player.theLeg = listOfLandmarks[15].DistanceToNextLandmark; player.theDalles = false; } if (player.ShowMessage) { Message(player, listOfLandmarks); } if (!player.AtLandmark) { Console.WriteLine(" Press ENTER to size up the situation"); } Status(player); if (player.LeavingALandmark) { if (player.ArrivingLanmark) { InputDetection.YesOrNo(player, shop, listOfLandmarks); } else { InputDetection.SpacebarAndCycle(player, shop, listOfLandmarks); player.LeavingALandmark = false; } if (player.gameMenuInput == "Y") { GameMenu.ShowRiverCrossing(player); GameMenu.PrintGameMenu(player, shop, listOfLandmarks); } if (player.gameMenuInput == "N") { GameMenu.PrintGameMenu(player, shop, listOfLandmarks); } if (player.gameMenuInput == "") { //GameMenu.PrintGameMenu(player, shop, listOfLandmarks); } } if (!player.AtLandmark) { while (Console.KeyAvailable) { if (Console.ReadKey(true).Key == ConsoleKey.Enter) { player.insidecycle = true; PrintGameMenu(player, shop, listOfLandmarks); } } System.Threading.Thread.Sleep(1000); } } player.insidecycle = false; }
static void Main(string[] args) { //INIT bool startGame = true; while (startGame) { Program program = new Program(); Player player = new Player(); Shop shop = new Shop(); List <Landmarks> listOfLandmarks = new List <Landmarks>(); program.gameon(player, shop, listOfLandmarks); var input = 1; if (player.debug) { player.occupation = "Farmer"; player.scoreFactor = 3;//banker = 1, carpenter = 2, farmer = 3 player.money = 4; player.name1 = "Gunni"; player.name2 = "Liney"; player.name3 = "Birta"; player.name4 = "Victor"; player.name5 = "Margret"; string date = "01-03-1848"; DateTime dateOfDeparture = Convert.ToDateTime(date); player.date = dateOfDeparture; player.numberOfOxs = 6; player.numberOfYokes = 3; player.poundsOfFoods = 140; player.setsOfClothing = 4; player.money = 500; player.ammo = 57; player.spareParts = 6; player.wagonWheel = 2; player.wagonAxel = 2; player.wagonTounge = 2; } else { input = Menus.StartScreenMenu(); if (input == 1) { Menus.OccupationMenu(player, shop); } if (input == 1 || input == 2 || input == 3) { Menus.NameMenu(player); } Menus.DateOfDeparture(player); Console.Clear(); Store.TheStore(player, shop); //Gameloop InputDetection.Spacebar(shop); } while (player.GameIsOn) { player.Landmark = listOfLandmarks[player.IndexForLandmarks].Name; GameMenu.PrintGameMenu(player, shop, listOfLandmarks); } } }