public static void PlayIntro() { Thread.Sleep(1000); Console.WriteLine(GameElements.GetTitle()); Console.WriteLine(GameElements.GetLineSolid()); Thread.Sleep(1000); Console.WriteLine(GameElements.GetMenu()); Thread.Sleep(1000); }
private static void PrintGameplayUI(Player player, Player opponent, int stage) { Console.Clear(); Console.WriteLine(GameElements.GetTitle()); Console.WriteLine(GameElements.GetLineSolid()); Console.WriteLine($" Opponent:"); Console.WriteLine(player.OpponentBattlefield.ToString()); Console.WriteLine($" You:"); Console.WriteLine(player.PlayerBattlefield.ToString()); //Console.WriteLine($" What Opponent sees:"); //Console.WriteLine(opponent.OpponentBattlefield.ToString()); Console.WriteLine(GameElements.GetLegend()); Console.WriteLine(GameElements.GetLineSolid()); Console.WriteLine(GameElements.GetCredits()); Console.WriteLine($"\n Stage {stage}"); }
public static void ShowStatistics() { Console.Clear(); Thread.Sleep(1000); Console.WriteLine(GameElements.GetTitle()); Console.WriteLine(GameElements.GetLineSolid()); Thread.Sleep(1000); Console.WriteLine(GameElements.GetStatistics()); Thread.Sleep(3000); Console.WriteLine(GameElements.GetPressKeyMessage()); Console.ReadKey(); Console.Clear(); }
public static void ShowInstructions() { Console.Clear(); Thread.Sleep(1000); Console.WriteLine(GameElements.GetTitle()); Console.WriteLine(GameElements.GetLineSolid()); Battlefield instructionsBattlefield = BattlefieldGenerator.GenerateNewBattlefield(); Thread.Sleep(1000); Console.WriteLine($" Instructions:"); Thread.Sleep(1000); Console.WriteLine(instructionsBattlefield.ToString()); Thread.Sleep(1000); Console.WriteLine(GameElements.GetLegend()); Thread.Sleep(3000); Console.WriteLine(" Both opponents should place"); Thread.Sleep(750); Console.WriteLine(" - 1 tanker (TTTT),"); Thread.Sleep(750); Console.WriteLine(" - 2 submarines (SSS),"); Thread.Sleep(750); Console.WriteLine(" - 3 carriers (CC),"); Thread.Sleep(750); Console.WriteLine(" - 4 boats (B) on their field."); Thread.Sleep(1500); Console.WriteLine("\n The 4 boats (B) can be placed "); Thread.Sleep(750); Console.WriteLine(" anywhere."); Thread.Sleep(750); Console.WriteLine(" The other vessels should be"); Thread.Sleep(750); Console.WriteLine(" placed in such a way that"); Thread.Sleep(750); Console.WriteLine(" 0 or 1 of its modules lay on"); Thread.Sleep(750); Console.WriteLine(" the sides/edges of the field."); Thread.Sleep(5000); Console.Clear(); Console.WriteLine(GameElements.GetTitle()); Console.WriteLine(GameElements.GetLineSolid()); Console.WriteLine($" Instructions:"); Console.WriteLine($" ╔═══╦═════════════════════╗"); Console.WriteLine($" ║ ║ A B C D E F G H I J ║"); Console.WriteLine($" ╠═══╬═════════════════════╣"); for (int row = 0; row < 10; row++) { Console.Write($" ║ {row} ║ "); for (int col = 0; col < 10; col++) { if ((row == 2 && col == 0) || (row == 2 && col == 1) || (row == 2 && col == 2) || (row == 2 && col == 3)) // DRAW CORRECT TANKER (TTTT) { Console.ForegroundColor = ConsoleColor.Green; Console.Write("T "); } else if ((row == 0 && col == 9)) // DRAW CORRECT BOAT (B) { Console.ForegroundColor = ConsoleColor.Green; Console.Write("B "); } else if ((row == 9 && col == 5) || (row == 9 && col == 6) || (row == 9 && col == 7)) // DRAW INCORRECT SUBMARINE (SSS) { Console.ForegroundColor = ConsoleColor.Red; Console.Write("S "); } else if ((row == 8 && col == 0) || (row == 9 && col == 0)) // DRAW INCORRECT CARRIER (CC) { Console.ForegroundColor = ConsoleColor.Red; Console.Write("C "); } else // DRAW EMPTY SLOT { Console.Write(" "); } Console.ForegroundColor = ConsoleColor.Cyan; } Console.Write("║\n"); } Console.WriteLine($" ╚═══╩═════════════════════╝"); Console.WriteLine(GameElements.GetLegend()); Thread.Sleep(1000); Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine($"\n CORRECT."); Thread.Sleep(1000); Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine($"\n NOT CORRECT!!!"); Console.ForegroundColor = ConsoleColor.Cyan; Thread.Sleep(5000); Console.WriteLine(GameElements.GetPressKeyMessage()); Console.ReadKey(); Console.Clear(); Console.WriteLine(GameElements.GetTitle()); Console.WriteLine(GameElements.GetLineSolid()); Console.WriteLine($" Instructions:"); Console.WriteLine(instructionsBattlefield.ToString()); Console.WriteLine(GameElements.GetLegend()); Thread.Sleep(3000); Console.WriteLine(" There should be at least 1 "); Thread.Sleep(750); Console.WriteLine(" empty slot between 2 vessels "); Thread.Sleep(750); Console.WriteLine(" placed on the field."); Thread.Sleep(1500); Console.WriteLine("\n In other words, 2 vessels "); Thread.Sleep(750); Console.WriteLine(" cannot \"touch\"."); Thread.Sleep(5000); Console.Clear(); Console.WriteLine(GameElements.GetTitle()); Console.WriteLine(GameElements.GetLineSolid()); Console.WriteLine($" Instructions:"); Console.WriteLine($" ╔═══╦═════════════════════╗"); Console.WriteLine($" ║ ║ A B C D E F G H I J ║"); Console.WriteLine($" ╠═══╬═════════════════════╣"); for (int row = 0; row < 10; row++) { Console.Write($" ║ {row} ║ "); for (int col = 0; col < 10; col++) { if ((row == 2 && col == 3) || (row == 2 && col == 4) || (row == 2 && col == 5) || (row == 2 && col == 6)) // DRAW INCORRECT TANKER (TTTT) { Console.ForegroundColor = ConsoleColor.Red; Console.Write("K "); } else if ((row == 4 && col == 1) || (row == 4 && col == 2) || (row == 4 && col == 3)) // DRAW CORRECT SUBMARINE (SSS) { Console.ForegroundColor = ConsoleColor.Green; Console.Write("S "); } else if ((row == 3 && col == 7) || (row == 4 && col == 7) || (row == 5 && col == 7)) // DRAW INCORRECT SUBMARINE (SSS) { Console.ForegroundColor = ConsoleColor.Red; Console.Write("S "); } else if ((row == 2 && col == 1)) // DRAW CORRECT BOAT (B) { Console.ForegroundColor = ConsoleColor.Green; Console.Write("B "); } else if ((row == 9 && col == 2)) // DRAW INCORRECT BOAT (B) { Console.ForegroundColor = ConsoleColor.Red; Console.Write("B "); } else if ((row == 8 && col == 3) || (row == 9 && col == 3)) // DRAW INCORRECT CARRIER (CC) { Console.ForegroundColor = ConsoleColor.Red; Console.Write("C "); } else if ((row == 6 && col == 1) || (row == 7 && col == 1)) // DRAW CORRECT CARRIER (CC) { Console.ForegroundColor = ConsoleColor.Green; Console.Write("C "); } else // DRAW EMPTY SLOT { Console.Write(" "); } Console.ForegroundColor = ConsoleColor.Cyan; } Console.Write("║\n"); } Console.WriteLine($" ╚═══╩═════════════════════╝"); Console.WriteLine(GameElements.GetLegend()); Thread.Sleep(1000); Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine($"\n CORRECT.\n"); Thread.Sleep(1000); Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine($" NOT CORRECT!!!"); Console.ForegroundColor = ConsoleColor.Cyan; Thread.Sleep(5000); Console.WriteLine(GameElements.GetPressKeyMessage()); Console.ReadKey(); Console.Clear(); }