Example #1
0
        public static Planet newOrLoadGame()
        {
            Planet loadPlanet = Universe.Earth;

            Console.ForegroundColor = ConsoleColor.DarkGreen;

            string upgradeQuestion1 = "Use the UP and DOWN arrow keys to select an option" +
                                      ", then press enter.";

            Console.SetCursorPosition((Console.WindowWidth - upgradeQuestion1.Length) / 2, 6);
            Console.WriteLine(upgradeQuestion1);

            List <string> newOrLoad = new List <string> ()
            {
                "New Game", "Load Saved Game"
            };
            int selected = ListNavigation.scrollList(newOrLoad, 8);

            if (selected == 0)
            {
                Console.ForegroundColor = ConsoleColor.DarkGreen;

                string loadQuestion = "Starting a new game will erase your current Save data. Are you Sure?";

                Console.SetCursorPosition((Console.WindowWidth - upgradeQuestion1.Length) / 2, 12);
                Console.WriteLine(loadQuestion);

                List <string> areYouSure = new List <string> ()
                {
                    "Yes, Start New Game", "No, Load Current Saved Game"
                };
                selected = ListNavigation.scrollList(areYouSure, 14);

                if (selected == 1)
                {
                    LoadGame load = new LoadGame();
                    loadPlanet = load.LoadG();
                }
                else
                {
                    Console.SetCursorPosition(0, 22);
                    Console.ForegroundColor = ConsoleColor.DarkGreen;
                    Console.WriteLine("What is your name?");
                    Game.NewPlayer.name = Console.ReadLine();
                }
            }
            Console.Title = Game.NewPlayer.name + ": A Life Well Lived";
            return(loadPlanet);
        }