Files
FinalBattle/Program.cs

64 lines
2.0 KiB
C#

string? input;
Console.Clear();
ColoredConsole.WriteLine("------------------------------------------------------------------", ConsoleColor.Cyan);
ColoredConsole.WriteLine("Welcome True Programmer, to the final battle for the realms of C#.", ConsoleColor.Cyan);
Thread.Sleep(1000);
ColoredConsole.WriteLine("\nThis will be the final battle against the Uncoded One..."
+ "\nAre you ready?", ConsoleColor.Cyan);
ColoredConsole.WriteLine("--------------------------------------------------------"
+ "----------", ConsoleColor.Cyan);
Console.ReadLine();
while (true)
{
try
{
Console.Clear();
ColoredConsole.WriteLine("Game mode:", ConsoleColor.Green);
Console.WriteLine("\n1. Player vs Computer\n2. Player vs Player\n3. Computer vs Computer");
ColoredConsole.WriteLine("-----------------------", ConsoleColor.Cyan);
input = ColoredConsole.Prompt("Enter a game mode");
if (input == "1")
{
GameState.Instance.herosAIControl = false;
GameState.Instance.monstersAIControl = true;
break;
}
if (input == "2")
{
GameState.Instance.herosAIControl = false;
GameState.Instance.monstersAIControl = false;
break;
}
if (input == "3")
{
GameState.Instance.herosAIControl = true;
GameState.Instance.monstersAIControl = true;
break;
}
else
{
ColoredConsole.WriteLine("Sorry. That isn't a valid input...", ConsoleColor.Red);
Thread.Sleep(1000);
continue;
}
}
catch (FormatException)
{
ColoredConsole.WriteLine("Sorry. That isn't a valid input...", ConsoleColor.Red);
Thread.Sleep(1000);
continue;
}
}
Player player = new Player();
GameState.Instance.heros.Add(player);
Console.Clear();
Console.Write("Press Enter to to begin your battle to save True Programming...");
Console.ReadLine();
GameState.Instance.Run();