Creating a Retro Game Over Behavior

Andrew Crippen
2 min readMay 26, 2021

--

In this quick article I’ll show how I created a retro arcade style “Game Over”

Following the same setup in my last article I created a GameOver_text UI>Text object, changed my font, anchored to the center and changed the size.

I then made a variable in my UIManager script and assigned it in the inspector.

My UIManager is subscribed to an Action in my Player class that sends current Lives when the Player is damaged, if lives are less than 1 or equal to 0 then it runs the DamageSequence() method. This DamageSequence() method starts the GameOverTextFlashRoutine() coroutine.

In the GameOverTextFlashRoutine() coroutine I set the GameOver_text GameObject to Active and in the infinite while loop I set the text to “GAME OVER” and have it wait 0.7f seconds with my cached WaitForSeconds variable named _gameOverWFS. It then clears the text and waits another 0.7f seconds before repeating. It will continuously do this until the ‘R’ key is pressed to reload the scene. In my next article I will show how to load scenes.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Andrew Crippen
Andrew Crippen

Written by Andrew Crippen

Unity Developer/C# Programmer for VR, 2d,3d Games and other Immersive Interactive Experiences

No responses yet

Write a response