Understanding the reason for which the game starts over

Hello :slight_smile:

I have a question regarding the way the code works so far.
If the player guessed the wrong word, eventually the EndGame function would run and change the bGameOver to ‘true’. However, in the EndGame function there isn’t any call for restarting the game, so I must assume that the code goes back to line 19 and enters the ‘if’ statement since now the condition is fullfiled.
Is that correct? If so, how come? If not, how does the game get re-started?

Maybe my following question is the key to the answer - how does the “enter” key work and is followed by a wait for the player’s input? Is that just a black-box you made and we use it without creating it ourselves?

Thank you so much.
Maya

The terminal class has mapped “any key” to the UTerminal::OnKeyDown function which does this when enter is pressed.

This in turn calls OnInput on the cartridge

Thanks

Does that clear things up then?

For my current level of understanding, yes. Thanks for the quick reply.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms