Example #1
0
        static void Main(string[] args)
        {
            
            SetConsoleSize(80, 40);      // set console size to be larger than default

            bool ProgramRun = true;  // set while loop condition for replaying game until user wants to quit
            while (ProgramRun)
            {
                try                               // overarching error handling
                {
                    Arena arena = new Arena();    // creates Arena including creating userplayer, opponent, arenaLog
                    ProgramRun = arena.FightInArena();  // fight in arena until player quits which returns false and ends programRun while loop
                    if (!ProgramRun) break;
                }
                catch
                {
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.WriteLine("\nSorry something went wrong\nProgram will Restart");
                    Console.WriteLine("Please Press Enter");
                    Console.ReadLine();
                    Console.ResetColor();
                    Console.Clear();
                }
            }

        }