Retro Game over behaviour

Daniel Kirwan
2 min readApr 9, 2021

Do you remember playing games in an arcade? No? Well you missed out on some great gaming memories & it also means you’re not old. For my space shooter project I wanted to try and replicate the classic game over screen flash that happens when you die.

There are a few ways to do this in Unity and I will show you how I made mine.

You can see my text is behaving in a similar fashion to the image at the top of the article.

Now over to Unity. First, we need to create a Text object in the canvas that will store the text we want to appear on screen. If you do not have a Canvas in your hierarchy already then you can right-click anywhere in the hierarchy and click UI -> text. This will create the canvas for you and put the text object inside the canvas as a child object.

Now we need to type the text we want to display on screen.

Now that our object has been created we can now implement our flashing text. I already have a UIManager script but you could create a simple script just for this functionality if you desire and attach it to the object.

I have serialized the Text field in my script which allows me to drag the text I want to reference inside the Unity editor.

I then set up a coroutine that will allow me to get the desired behaviour that I want. When the player is dead I call the GameOverTextRoutine below.

My Gameover text object is already displayed once the player has died. So, in my coroutine I am delaying for 1 second and then turning that object off, then waiting for .5 of a second and then turning it back on. This will keep repeating as long as the isGameOver boolean is true.

And that’s it for getting a retro game over screen in Unity. Come back for more articles on working with Unity.

--

--