void OnUserInput(string input)
{
if (input == “menu”) //this donkey works
{
ShowMainMenu(“Welcome Back Starlord”);
}
else if (currentScreen == Screen.MainMenu)
RunMainMenu(input);
}
void RunMainMenu(string input)
So the problem I’m having is that I can’t quite wrap my head around why we have to declare the (string input) in the RunMainMenu function. Because the ìnput parameter has already been declared in the OnUserInput function and that’s where the information is coming from for all input related statements.
And also while we call the RunMainMenu function we just use input in the parentheses.
So my question is, is this because how functions are meant to be written(declaring the parameter type everytime you use a parameter EVEN THOUGH it’s been declared as a parameter before, in another function) or is there something else I do not understand.
Sorry for the messy writing