Step 12 — Game Over, Man

Nicholas Lim
2 min readMay 4, 2021

--

A game over screen is a classic thing for a game to have, even better if it has an old school flashing effect.

To add this, start by adding the Text similar to how the score was added. The Horizontal and Vertical overflow might need to be set to overflow to deal with the increased font size, or you could resize the Text object.

As it’s a game over screen, it should only appear at the end of the game. The Text object can be enabled and disabled in the code, so update the UI Manager script.

As the game starts, the game over Text object is disabled and won’t appear in the game. But when the GameOverSequence is called upon player lives becoming zero, starting the coroutine that gives it the flicker.

In the coroutine the Text object is enabled, and the text section of the Text object will turn off and on after 0.75 seconds, forever and ever in the cold empty void of space, until the player restarts the game, which will be covered in the next article.

--

--

No responses yet