Beispiel #1
0
        public static void showMainMenu()
        {
            Boolean hasSelectedSpecies = false;
            Boolean hasSelectedClass   = false;

            //Draw the species list
            while (!hasSelectedSpecies)
            {
                string bufferClear = "";
                for (int x = 0; x < 69; x++)
                {
                    bufferClear += " ";
                }
                ConsoleEx.DrawRectangle(BorderStyle.Text, 0, 0, 70, Species.speciesList.Length + 3, false);
                Util.writeLn("Select a species", 2, 0);
                Species.drawAllSpecies();
                Util.writeLn(bufferClear, 1, Species.speciesList.Length + 2);
                Util.writeLn(Species.speciesList[selectedSpecies].lore, 1, Species.speciesList.Length + 2);
                ConsoleKeyInfo keyInfo = Console.ReadKey();
                if (keyInfo.Key == ConsoleKey.DownArrow)
                {
                    selectedSpecies++;
                    if (selectedSpecies > Species.speciesList.Length - 1)
                    {
                        selectedSpecies = 0;
                    }
                }
                if (keyInfo.Key == ConsoleKey.UpArrow)
                {
                    selectedSpecies--;
                    if (selectedSpecies < 0)
                    {
                        selectedSpecies = Species.speciesList.Length - 1;
                    }
                }
                if (keyInfo.Key == ConsoleKey.Enter)
                {
                    currSpecies        = Species.speciesList[selectedSpecies];
                    hasSelectedSpecies = true;
                }
            }
            Console.Clear();
            selectedSpecies = 0;
            while (!hasSelectedClass)
            {
                ConsoleEx.TextColor(ConsoleForeground.DarkGray, ConsoleBackground.Black);
                ConsoleEx.DrawRectangle(BorderStyle.Text, 0, Class.classList.Length + 2, 70, Species.speciesList.Length + 3, false);
                Util.writeLn("Select a species", Class.classList.Length + 4, 0);
                Species.drawAllSpecies(Class.classList.Length + 2);
                Util.writeLn(currSpecies.lore, 1, Species.speciesList.Length + 2 + Class.classList.Length + 2);

                ConsoleEx.TextColor(ConsoleForeground.LightGray, ConsoleBackground.Black);
                ConsoleEx.DrawRectangle(BorderStyle.Text, 0, 0, 70, Class.classList.Length + 1, false);
                Util.writeLn("Select a class--Species: " + currSpecies.abbrv, 2, 0);
                Class.drawAllClasses();
                ConsoleKeyInfo keyInfo = Console.ReadKey();
                if (keyInfo.Key == ConsoleKey.DownArrow)
                {
                    selectedSpecies++;
                    if (selectedSpecies > Species.speciesList.Length - 1)
                    {
                        selectedSpecies = 0;
                    }
                }
                if (keyInfo.Key == ConsoleKey.UpArrow)
                {
                    selectedSpecies--;
                    if (selectedSpecies < 0)
                    {
                        selectedSpecies = Species.speciesList.Length - 1;
                    }
                }
                if (keyInfo.Key == ConsoleKey.Enter)
                {
                    currClass        = Class.classList[selectedSpecies];
                    hasSelectedClass = true;
                }
            }
            Console.Clear();
            Console.WriteLine("What is your name?");
            player = new Player(Console.ReadLine(), currSpecies, currClass);
            //Console.WriteLine("You are a " + player.identifier);
            Console.WriteLine();
            player.WriteStats();
            player.stats.calcStats();
            Console.ReadLine();
            world.genMap();
            levelMap.Add(Program.area + ":" + Program.floor, world);
            startGame();
        }