eugeneloza / castle-editor-tutorial

Moved to https://gitlab.com/EugeneLoza/castle-editor-tutorial
MIT License
2 stars 0 forks source link

Improve sentence: We’ve also added `if GameRunning then` condition... #17

Open michaliskambi opened 3 years ago

michaliskambi commented 3 years ago

This was spotted by @and3md . I'm submitting an issue before I forget :)

The sentence:

"""" We’ve also added if GameRunning then condition to avoid possible rare bug in case two popups will fire simultaneously. """"

seems too alarming. It may suggest that there's a mysterious bug in game code/engine code. Especially if reading this sentence "on its own", without previously reading explanation about what GameRunning does ("... The game starts running and stops after "Game Over" "). What "possible rare bug" do they mean?

As far as I understand, the point is just that you detect "game over" in each Update, and the point is illustrated by the code snippet right above the sentence with

if GameRunning then
  TUiState.Push(StateGameOver);
GameRunning := false;

I propose to change the sentence to:

""" We’ve also added if GameRunning then condition to avoid showing the "game over" popup repeatedly in each Update after the game ended. The line TUiState.Push(StateGameOver) should execute only once per game, not in every Update call. """