예제 #1
0
        // STARTS THE HIGH SCORES BOARD
        public static void Initialize()
        {
            List <string> allScores = GetAllScores();

            string[] currentScoreAndName;

            DrawItem.Draw(10, 0, "\n" + "                         HIGH SCORES:" + "\n");
            DrawItem.Draw(10, 3, "*========================================*");

            int linesNumber = (allScores.Count > 30) ? 30 : allScores.Count;

            for (int index = 0; index < allScores.Count; index++)
            {
                currentScoreAndName = allScores[index].Split(new char[] { '|' });

                string scores = "";

                if (currentScoreAndName[0] != "0000")
                {
                    scores = currentScoreAndName[0].TrimStart('0');
                }
                else
                {
                    scores = "0";
                }

                string lineString = String.Format("* Player {0}: {1}", currentScoreAndName[1], scores);
                DrawItem.Draw(10, 4 + index, lineString);
                DrawItem.Draw(51, 4 + index, "*");
            }

            if (allScores.Count < 5)
            {
                int emptyRows = 5 - allScores.Count;
                while (emptyRows != 0)
                {
                    DrawItem.Draw(10, 4 + (5 - emptyRows), "*");
                    DrawItem.Draw(51, 4 + (5 - emptyRows), "*");
                    emptyRows--;
                }
            }

            Console.WriteLine("\n" + "          *========================================*");

            DrawItem.Draw(25, WindowsSettings.WIN_HEIGHT - 4, "Click ESC to return");

            bool commandCorrect = false;

            while (!commandCorrect)
            {
                ConsoleKeyInfo pressedKey = Console.ReadKey(true);

                if (pressedKey.Key == ConsoleKey.Escape)
                {
                    Console.Clear();
                    StartMenu.Initialize();
                    commandCorrect = true;
                }
            }
        }
예제 #2
0
        static void Main()
        {
            // WINDOW Settings
            WindowsSettings.Initialize();

            // INITIAL Start Menu
            StartMenu.Initialize();

            // INITIAL THE GAME
            //  StartGame.Initialize();
            Terrain.Initialize();
            InfoAreas.Initialize();

            IRenderer        renderer        = new ConsoleRender(120, 50);
            IObjectOperator  objOperator     = new ObjectOperator();
            IQuestionManager questionManager = new StoreQuestion();
            Engine           myEngine        = new Engine(renderer, objOperator, questionManager);

            myEngine.Initialize();
            myEngine.Run();
        }