public static void StartLevelOne(Game game) { if (game.SetPlayerDeadCheck() == true) { GameOver(game); } else { Console.WriteLine("You woke up on an island. You feel hungry and thirsty. What do you do?"); string userInput = Console.ReadLine(); if (userInput.ToUpper() == "STATUS") { game.GetStatus(); StartLevelOne(game); } else if (userInput.ToUpper() == "EAT MEAL") { game.GetEatMeal(); StartLevelOne(game); } else if (userInput.ToUpper() == "EAT SNACK") { game.GetEatSnack(); StartLevelOne(game); } else if (userInput.ToUpper() == "DRINK WATER") { game.GetDrinkWater(); StartLevelOne(game); } else if (userInput.ToUpper() == "BUILD SHELTER" || userInput.ToUpper() == "FIND SHELTER" || userInput.ToUpper() == "CREATE SHELTER" || userInput.ToUpper() == "MAKE SHELTER" || userInput.ToUpper() == "SHELTER" || userInput.ToUpper() == "BUILD SHELTER") { Console.WriteLine("--------------------------------------------------------\nYou found shelter! LV.1\n--------------------------------------------------------"); game.SetTurnEnd(); StartLevelTwo(game); } else { game.SetMakeMistake(); StartLevelOne(game); } } }
static void Main() { Console.WriteLine("--------------------------------\nGAME RULES\nGet off the island to win the game.\nHOW TO PLAY: you will be prompted for an action. You can use an item at any prompt, but to progress need to make the right decisions.\nHOW TO USE ITEMS: you will start the game with a given amount of items that you can use. There are three types of consumables: meals, snacks and water bottles. When prompted for actions, as long as you have items in inventory, you can type 'eat meal', 'eat snack' or 'drink water'.\nType 'reset' at any time to restart game.--------------------------------"); // List<Game> itemList = new List<Game>(0); Console.WriteLine("Enter a player name:"); string name = Console.ReadLine(); Game game = new Game(name, 100, 100, 100, 2, 2, 2); Console.WriteLine("You woke up on an island. You feel hungry and thirsty. What do you do?"); string firstLevel = Console.ReadLine(); // game.GetStatus(); Console.WriteLine(game.GetStatus()); // if (firstLevel.ToUpper() == "EAT MEAL") // { // game.SetEatMeal(); // game.SetTurnEnd(); // } // else if (firstLevel.ToUpper() == "EAT SNACK") // { // } // else if (firstLevel.ToUpper() == "DRINK WATER") // { // game.SetDrinkWater(); // game.SetTurnEnd(); // } // else if (firstLevel.ToUpper() == "BUILD SHELTER" || firstLevel.ToUpper() == "FIND SHELTER" || firstLevel.ToUpper() == "CREATE SHELTER" || firstLevel.ToUpper() == "MAKE SHELTER" || firstLevel.ToUpper() == "SHELTER" || firstLevel.ToUpper() == "BUILD SHELTER") // { // // game.SetTurnEnd(); // // game.newInventory(); // // game.SetRest(); // } // else // { // Console.WriteLine("Made a wrong or unavailable decision, as a result you are loosing health."); // game.SetTurnEnd(); // } }
public static void StartLevelTwo(Game game) { Console.WriteLine("You woke up on an island. You feel hungry and thirsty. What do you do?"); string userInput = Console.ReadLine(); if (userInput.ToUpper() == "STATUS") { game.GetStatus(); StartLevelTwo(game); } else if (userInput.ToUpper() == "EAT MEAL") { game.GetEatMeal(); StartLevelTwo(game); } else if (userInput.ToUpper() == "EAT SNACK") { game.GetEatSnack(); StartLevelTwo(game); } else if (userInput.ToUpper() == "DRINK WATER") { game.GetDrinkWater(); StartLevelTwo(game); } else if (userInput.ToUpper() == "BUILD SHELTER" || userInput.ToUpper() == "FIND SHELTER" || userInput.ToUpper() == "CREATE SHELTER" || userInput.ToUpper() == "MAKE SHELTER" || userInput.ToUpper() == "SHELTER" || userInput.ToUpper() == "BUILD SHELTER") { game.SetTurnEnd(); // game.newInventory(); // game.SetRest(); // LevelThree(game); } else { game.SetMakeMistake(); StartLevelTwo(game); } }