Example #1
0
        // Functions
        public void GetInput(Player player, ConsolePrompt console, Map map)
        {
            ConsoleKeyInfo KeyInput = Console.ReadKey(true);

            if (KeyInput.Key == ConsoleKey.UpArrow)
            {
                player.MovePlayer(player, "UpArrow", map);
            }
            else if (KeyInput.Key == ConsoleKey.DownArrow)
            {
                player.MovePlayer(player, "DownArrow", map);
            }
            else if (KeyInput.Key == ConsoleKey.LeftArrow)
            {
                player.MovePlayer(player, "LeftArrow", map);
            }
            else if (KeyInput.Key == ConsoleKey.RightArrow)
            {
                player.MovePlayer(player, "RightArrow", map);
            }
            else if (KeyInput.Key == ConsoleKey.F1)
            {
                console.ConsolePrmpt(map, player);
            }
        }
Example #2
0
        public void MainMenuList(Menu menu, Design design, ConsolePrompt console, Map map)
        {
            ConsoleKeyInfo key = Console.ReadKey(true);

            switch (key.Key)
            {
            case ConsoleKey.DownArrow:
                if (menu.mMenuListSelectedId < design.mMenuList.Length - 1)
                {
                    menu.mMenuListSelectedId++;
                }
                else
                {
                    menu.mMenuListSelectedId = 0;
                }
                break;

            case ConsoleKey.UpArrow:
                if (menu.mMenuListSelectedId > 0)
                {
                    menu.mMenuListSelectedId--;
                }
                else
                {
                    menu.mMenuListSelectedId = design.mMenuList.Length - 1;
                }
                break;

            case ConsoleKey.LeftArrow:

                break;

            case ConsoleKey.RightArrow:

                break;

            case ConsoleKey.Enter:
                switch (menu.mMenuListSelectedId)
                {
                case 0:
                    menu.exitMenu = true;
                    break;

                case 1:
                    // Load game
                    Console.WriteLine("\nLoad Game...Page Under Construction...");
                    Console.ReadLine();
                    break;

                case 2:
                    // Credits
                    Console.WriteLine("\nCredits...Page Under Construction...");
                    Console.ReadLine();
                    break;

                case 3:
                    Environment.Exit(1);
                    break;
                }
                break;

            case ConsoleKey.F1:
                console.ConsolePrmpt(map, null);
                break;
            }
        }