예제 #1
0
        private static void Navigation()
        {
            Console.CursorVisible = false;

            ConsoleKeyInfo cki;

            while (true)
            {
                cki = Console.ReadKey();
                if (cki.Key == ConsoleKey.Enter)
                {
                    Sounds.MainMenuSound(true);
                    Sounds.OverTheGameSound();
                    break;
                }
                else if (cki.Key == ConsoleKey.F1)
                {
                    DrawInfoScreen();
                    return;
                }
                else if (cki.Key == ConsoleKey.F2)
                {
                    DrawScoreBoard();
                    return;
                }
                else if (cki.Key == ConsoleKey.Escape)
                {
                    playSound = false;
                    DrawMainScreen();
                    return;
                }
                else if (cki.Key == ConsoleKey.Q)
                {
                    Console.Clear();
                    Environment.Exit(1);
                }
            }
        }
예제 #2
0
        public static void DrawMainScreen()
        {
            Console.Clear();

            string[] froggyPicture = new string[]
            {
                @"            _____________________                     ",
                @"            |###################|                     ",
                @"            |###################|                     ",
                @"            |###################|                     ",
                @"((-----------------------------------------           ",
                @"| \         /  /@@ \      /@@ \  \                    ",
                @" \ \,      /  (     )    (     )  \            _____  ",
                @"  \ \      |   \___/      \___/   |           /  __ \ ",
                @"   \   *-__/                      \           | |  | |",
                @"      *-_                          -_         | |     ",
                @"         \    -.  _________   .-   __ -.__.-((  ))    ",
                @"          \,    \^    U    ^/     /   -___--((  ))    ",
                @"            \,   \         /    /'            | |     ",
                @"             |    \       /   /'              | |     ",
                @"             |      -----     \               | |     ",
                @"            /                   *-._          | |     ",
                @"           /   /\          /*-._    \         | |     ",
                @"          /   /   \______/      /   /         | |     ",
                @"         /   /                 /   /          | |     ",
                @"        /. ./                  |. .|                  ",
                @"       /  | |                  / | \                  ",
                @"      /   |  \                /  |  \                 ",
                @"     /.-./.-.|               /.-.|.-.\                "
            };

            string[] froggerText = new string[]
            {
                @"  .----------------------------------------------------------------.  ",
                @" /  .-.    ______ _____   ____   _____  _____ ______ _____     .-.  \ ",
                @"|  /   \  |  ____|  __ \ / __ \ / ____|/ ____|  ____|  __ \   /   \  |",
                @"| |\_.  | | |__  | |__) | |  | | |  __| |  __| |__  | |__) | |    /| |",
                @"|\|  | /| |  __| |  _  /| |  | | | |_ | | |_ |  __| |  _  /  |\  | |/|",
                @"| `---' | | |    | | \ \| |__| | |__| | |__| | |____| | \ \  | `---' |",
                @"|       | |_|    |_|  \_\\____/ \_____|\_____|______|_|  \_\ |       |",
                @"|       |----------------------------------------------------|       |",
                @"\       |                                                    |       /",
                @" \     /                                                      \     / ",
                @"  `---'                                                        `---'  ",
            };

            string[] navigationInstructions = new string[]
            {
                "PRESS ENTER TO START THE GAME",
                "",
                "PRESS F1 FOR INSTRUCTIONS",
                "PRESS F2 FOR SCOREBOARD",
                "PRESS Q TO QUIT"
            };

            Console.SetCursorPosition(0, (MainProgram.MaxHeight - froggyPicture.Length - froggerText.Length - navigationInstructions.Length) / 2);

            Console.ForegroundColor = ConsoleColor.Green;
            PrintStringArray(froggyPicture);
            PrintStringArray(froggerText);
            Console.ForegroundColor = ConsoleColor.DarkYellow;
            PrintStringArray(navigationInstructions);
            if (playSound)
            {
                Sounds.MainMenuSound(false);
            }

            Navigation();
        }