Example #1
0
        static void KeyMenuInitialise()
        {
            KeyPress.AddControl("Menu");
            KeyPress.Set("Menu", ConsoleKey.DownArrow, Keys[needOption.menuDown]);
            KeyPress.Set("Menu", ConsoleKey.UpArrow, Keys[needOption.menuUp]);
            KeyPress.Set("Menu", ConsoleKey.Enter, Keys[needOption.menuPress]);

            KeyPress.AddControl("Snake");

            KeyPress.Set("Snake", ConsoleKey.UpArrow, Keys[needOption.snakeUp]);
            KeyPress.Set("Snake", ConsoleKey.DownArrow, Keys[needOption.snakeDown]);
            KeyPress.Set("Snake", ConsoleKey.LeftArrow, Keys[needOption.snakeLeft]);
            KeyPress.Set("Snake", ConsoleKey.RightArrow, Keys[needOption.snakeRigh]);

            KeyPress.Set("Snake", ConsoleKey.W, Keys[needOption.secondSnakeUp]);
            KeyPress.Set("Snake", ConsoleKey.S, Keys[needOption.secondSnakeDown]);
            KeyPress.Set("Snake", ConsoleKey.A, Keys[needOption.secondSnakeLeft]);
            KeyPress.Set("Snake", ConsoleKey.D, Keys[needOption.secondSnakeRigh]);

            KeyPress.Set("Snake", ConsoleKey.Escape, Keys[needOption.snakePause]);
        }