According to the lecture, when player pressed Enter key, the system won the game and inside that same if else statement, I would like to ask the player to continue playing or terminate?
Observed:
The system loops at void Update() constantly, not receiving inputs for the nested if else statement. Nothing happens when I pressed Y or N keys.
Expected:
After pressing Enter key, go inside if else, loop for user input of Y = Yes or N = No to continue playing or terminating the game.
So your user presses Return, the update function will start again before they even get chance to press Y. You are treating it as if the code will pause execution for the input. It doesn’t unfortunately.
You’d have to hold down Return and Y at the same time for this to work
You will have to manage a state or flag to get this to work. Maybe try the Text 101 lesson and this will be a bit clearer
Basically your app will be in one or several states and the Update calls the relevant function for that state.
The specific state function will then handle only the inputs relevant to that state.
I think it would be a good exercise to apply what you learn in that later lesson to try and fix your original problem. They are somewhat different apps (not hugely though) but the knowledge there would be enough to adapt it.