Creating a HUD (part 3)

Creating a Game Over Screen

Every game needs a game Over screen especially when the player has lost all its lives or has enter a instant death trap such as spikes. This game over screen would also give the player the ability to start over again or return back to the Main Menu.

Prepping the Game Over screen:

I made the layout within Adobe Illustrator and made sure that there will be two buttons that will control the level restart and another button that take the player back into the main menu. Save the final layout as a PNG file and import the file into Unity.

Slice the image into the desired size and create a new UI Panel within the Canvas. Then we are going create new image objects within the Panel and organize the images from top to down.

Finally we are going to create a new animation within the Panel itself so we can animate all 3 components within the panel.

Within the Animator we are going to create a parameter which will trigger the popup whenever the parameter is called. We are also going to create an empty state that will become the default state.

Triggering the Game Over Screen:

Within the player script in the the Damage method, we are going to trigger the Animation parameter whenever the health is less than 1.

Now whenever the player health is below one, the pop up will trigger and prompting the animation.

A Designer, an Illustrator and a massive tech geek aspiring to become a professional Unity Developer.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

p value to z score

Have You Heard About QUIC Protocol Yet?

The Tricky Business of Managing Technical Debt

Task 2 Week 8 & 9 & 10

All About Nginx

Create Android and IOS applications using Expo-bar-flow

React Native app using Expo- bar flow

What is call stack, method frames, stack frames?

A Sign of Things to Come

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Simon Truong

Simon Truong

A Designer, an Illustrator and a massive tech geek aspiring to become a professional Unity Developer.

More from Medium

Understanding IDamageable Interfaces (part 1)

3rd Person Controller Using Cinemachine Virtual Camera On Mobile

USING GAMEOBJECT ARRAY FOR SPAWN MANAGER

Understanding Abstract Class