public static void TitleScreen() { int width = 28; PrintUtils.GetHash(width); PrintUtils.CenterPadHash("Welcome to Bordertale!", width); PrintUtils.CenterPadHash("- Play -", width); PrintUtils.CenterPadHash("- Resume -", width); PrintUtils.CenterPadHash("- Help -", width); PrintUtils.CenterPadHash("- Acknoledgements -", width); PrintUtils.CenterPadHash("- Quit -", width); PrintUtils.CenterPadHash("Copyright 2021 tejmen09", width); PrintUtils.GetHash(width); bool inLoop = true; while (inLoop) { string option = PrintUtils.Input().ToLower(); switch (option) { case "play": inLoop = false; MainGame.StartGame(); break; case "help": inLoop = false; HelpScreen(false); break; case "quit": inLoop = false; PrintUtils.GetHash(15); PrintUtils.CenterPadHash("GOODBYE!!", 15); PrintUtils.GetHash(15); Thread.Sleep(500); Environment.Exit(0); break; case "acknowledgements": inLoop = false; AcknowledgementsScreen(); break; case "resume": inLoop = false; MainGame.MainGameLoop(); break; default: Console.WriteLine("Please enter a valid command."); break; } } }
public static void StartGame() { PrintUtils.SlowPrint("What is your name young traveller?"); player.name = PrintUtils.Input(); if (player.name == "dev") { player.name = "Developer"; player.job = new Job("Fighter", 120, 40); player.SetJob(); Map.PopulateLocation(); MainGameLoop(); } PrintUtils.SlowPrint($"What is will your role be {player.name}?"); Console.WriteLine("(You can be a Fighter, Wizard or healer)"); bool inLoop = true; while (inLoop) { string playerJob = PrintUtils.Input().ToLower(); switch (playerJob) { case "fighter": inLoop = false; player.job = new Job("Fighter", 120, 40); break; case "wizard": inLoop = false; player.job = new Job("Healer", 200, 20, 40); break; case "healer": inLoop = false; player.job = new Job("Wizard", 300, 20, 20); break; default: Console.WriteLine("Please enter a valid role."); break; } } player.SetJob(); Map.PopulateLocation(); PrintUtils.SlowPrint($"Welcome {player.name} the {player.job.name}."); PrintUtils.SlowPrint("Welcome to this fanatasy world!", 30); PrintUtils.SlowPrint("Just dont get lost...", 100); PrintUtils.SlowPrint("(Cough, Cough)", 20); PrintUtils.GetHash(28); PrintUtils.CenterPadHash("Let's Jump In!", 28); PrintUtils.GetHash(28); MainGameLoop(); }
public static void TitleScreen() { int width = 28; Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine(" _______ _______ ______ ______ _______ ______ _______ _______ ___ _______ "); Console.ForegroundColor = ConsoleColor.DarkYellow; Console.WriteLine("| _ || || _ | | | | || _ | | || _ || | | |"); Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine("| |_| || _ || | || | _ || ___|| | || |_ _|| |_| || | | ___|"); Console.ForegroundColor = ConsoleColor.DarkGreen; Console.WriteLine("| || | | || |_||_ | | | || |___ | |_||_ | | | || | | |___ "); Console.ForegroundColor = ConsoleColor.Blue; Console.WriteLine("| _ | | |_| || __ || |_| || ___|| __ | | | | || |___ | ___|"); Console.ForegroundColor = ConsoleColor.DarkBlue; Console.WriteLine("| |_| || || | | || || |___ | | | | | | | _ || || |___ "); Console.ForegroundColor = ConsoleColor.Magenta; Console.WriteLine("|_______||_______||___| |_||______| |_______||___| |_| |___| |__| |__||_______||_______|\n"); Console.ResetColor(); PrintUtils.GetHash(width, ConsoleColor.Yellow); PrintUtils.CenterPadHash("Welcome to Bordertale!", width, ConsoleColor.Yellow); PrintUtils.CenterPadHash("- Play -", width, ConsoleColor.Yellow); PrintUtils.CenterPadHash("- Resume -", width, ConsoleColor.Yellow); PrintUtils.CenterPadHash("- Help -", width, ConsoleColor.Yellow); PrintUtils.CenterPadHash("- Acknowledgements -", width, ConsoleColor.Yellow); PrintUtils.CenterPadHash("- Quit -", width, ConsoleColor.Yellow); PrintUtils.CenterPadHash("Copyright 2021 tejmen09", width, ConsoleColor.Yellow); PrintUtils.GetHash(width, ConsoleColor.Yellow); bool inLoop = true; while (inLoop) { string option = PrintUtils.Input().ToLower(); switch (option) { case "play": inLoop = false; MainGame.StartGame(); break; case "help": inLoop = false; HelpScreen(false); break; case "quit": inLoop = false; PrintUtils.GetHash(15, ConsoleColor.DarkYellow); PrintUtils.CenterPadHash("GOODBYE!!", 15, ConsoleColor.DarkYellow); PrintUtils.GetHash(15, ConsoleColor.DarkYellow); Thread.Sleep(500); Environment.Exit(0); break; case "acknowledgements": inLoop = false; AcknowledgementsScreen(); break; case "resume": inLoop = false; // TODO Add ResumeGame() Functionality, ideally from a json object stored through a file. break; default: Console.WriteLine("Please enter a valid command."); break; } } }
public static void Prompt() { Console.WriteLine(); PrintUtils.GetHash(31); Console.WriteLine("What would you like to do?"); Console.WriteLine("(You can 'move', 'quit', 'look', 'talk', 'equip', 'help', 'stats' or 'act' or 'mission')"); bool inLoop = true; while (inLoop) { string action = PrintUtils.Input().ToLower(); string[] words = action.Split(' '); switch (words[0]) { case "quit": inLoop = false; EndGame(); break; case "look": inLoop = false; player.Examine(); break; case "act": inLoop = false; player.Act(); break; case "talk": inLoop = false; player.Talk(); break; case "equip": inLoop = false; // @todo add Player.Equip() break; case "stats": inLoop = false; Screens.Stats(); break; case "help": inLoop = false; Screens.HelpScreen(true); break; case "mission": inLoop = false; // @todo add Player.Missions() break; case "money": inLoop = false; player.money = Convert.ToInt32(PrintUtils.Input("Money = ?")); Console.WriteLine(player.money); break; case "move": inLoop = false; if (words.Length <= 1) { string direction = words[1]; player.Move(direction); } else if (words.Length == 3 & words[1] == "tp") { string destination = words[2]; player.Move(true, destination); } break; default: Console.WriteLine("Unknown action, try again."); break; } } }
public static void ShopScreen() { PrintUtils.GetHash(103, ConsoleColor.Cyan); Console.ForegroundColor = ConsoleColor.Cyan; Console.Write(PrintUtils.CenterPadHashReturn("SHOP", 103)); Console.WriteLine($@" # # ████████████████ # ██████████████████████████ # # ██████ ██████ # ██ ▒▒██ # ██▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒██ # # ██ ▒▒██ ██ ▒▒██ # ██ ▒▒██ # ██▒▒ ▒▒██ # # ██ ▒▒██ ██ ▒▒██ # ██ ▒▒▒▒▒▒▒▒ ▒▒██ # ██▒▒ ▒▒██ # # ██ ▒▒██ ██ ▒▒██ # ██ ▒▒▒▒████▒▒ ▒▒██ # ██▒▒ ▒▒██ # # ██ ▒▒██ ██ ██ # ██ ▒▒██ ██ ▒▒██ # ██▒▒ ▒▒██ # #██ ▒▒▒▒██ ██▒▒ ▒▒██# ██ ▒▒██ ██ ▒▒██ # ██▒▒ ▒▒██ # #██▒▒▒▒▒▒██ ██▒▒▒▒▒▒██# ██ ▒▒██ ██ ▒▒██ # ██▒▒ ▒▒██ # #████████ ████████# ██▒▒▒▒██ ██▒▒▒▒██ # ██▒▒ ▒▒██ # # # ████████ ████████ # ██▒▒ ██ ▒▒██ # # [1]Boots ₴ 10 # [2]Leggings ₴ 20 # ██▒▒ ██████ ▒▒██ # ############################################################## ██▒▒ ██ ▒▒██ # # # ████ ████ # ██▒▒ ▒▒██ # # # ████ ▒▒██ ██ ████ # ██▒▒ ▒▒██ # # ████████████ # ██ ▒▒██ ██ ▒▒██ # ██▒▒ ▒▒██ # # ██ ▒▒██ # ██ ████ ▒▒██ # ██▒▒ ▒▒██ # # ██ ▒▒▒▒██ # ██▒▒ ▒▒▒▒██ # ██▒▒ ▒▒██ # # ██ ▒▒▒▒▒▒██ # ██ ▒▒▒▒██ # ██▒▒ ▒▒██ # # ██ ████████▒▒▒▒██ # ██▒▒ ▒▒▒▒██ # ██▒▒ ▒▒██ # # ██ ████████████▒▒██ # ██ ▒▒██ # ██▒▒ ▒▒██ # # ██ ████████████▒▒██ # ██ ▒▒▒▒██ # ██▒▒▒▒▒▒▒▒▒▒██ # # ████ ████ # ██▒▒ ▒▒▒▒▒▒██ # ██▒▒▒▒▒▒██ # # # ██▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒██ # ██▒▒██ # # # ██▒▒▒▒▒▒▒▒▒▒▒▒██ # ██ # # # ████████████ # # # # # # # [3]Helmet ₴ 30 # [4]Chestplate ₴ 40 # [5]Shield ₴ 35 #"); PrintUtils.GetHash(103); PrintUtils.CenterPadHash("Type the number of the you want to buy to purchase. Type back to go back.", 103); PrintUtils.CenterPadHash($"You have ₴{MainGame.player.money.ToString()}.", 103); PrintUtils.GetHash(103); bool inLoop = true; while (inLoop) { string cart = PrintUtils.Input().ToLower(); switch (cart) { case "1": inLoop = false; MainGame.player.Acquire(Helpers.ItemFactory.CreateItem("boots")); break; case "2": inLoop = false; MainGame.player.Acquire(Helpers.ItemFactory.CreateItem("leggings")); break; case "3": inLoop = false; MainGame.player.Acquire(Helpers.ItemFactory.CreateItem("helmet")); break; case "4": inLoop = false; MainGame.player.Acquire(Helpers.ItemFactory.CreateItem("chestplate")); break; case "5": inLoop = false; MainGame.player.Acquire(Helpers.ItemFactory.CreateItem("shield")); break; case "back": inLoop = false; MainGame.Prompt(); break; default: Console.WriteLine("Please enter a valid number."); break; } } }