2021-In game help screen

From TRCCompSci - AQA Computer Science
Jump to: navigation, search

Issue

There is no in game help available within the game, Players will need to know all the commands available.

Solution

Create an option for 'help'. This would need to be implement so it doesn't take one of the three commands of the player.

PlayGame

Within the PlayGame method, find the following for loop:

                for (int count = 1; count <= 3; count++)
                {
                    Console.Write("Enter command: ");
                    commands.Add(Console.ReadLine().ToLower());
                }

This for loop will allow the user to enter 3 separate commands. If one of these is 'help' we want to display the help information, but not count towards their 3 commands.

                for (int count = 1; count <= 3; count++)
                {
                    string command = "";
                    do
                    {
                        Console.Write("Enter command: ");
                        command = Console.ReadLine().ToLower();
                    }
                    while (command == "help");
                    commands.Add(command);
                }