Game Win Screen

The last one we will need is the Game Win screen for when you finish the game. This one is very similar to the Game Over screen, with a replay from the Start button and then the Quit button.

1. Create a new Scene again with the shortcut command.

2. Find the gameWin_background under the _backgrounds folder in the Project Browser and drag it into the Scene. Once again, make sure its Transform values are all set to 0, 0, 0 for the translates.

3. Create a new script in the _scripts folder. Call this one “GameWinScript.”

4. Double-click to open the script, and adjust its contents to match Listing 10.4.

5. Save the Scene with the name “Game_Win.”

Listing 10.4 The GameWinScript Script

public class GameWinScript ...

Get Learning 2D Game Development with Unity®: A Hands-On Guide to Game Creation now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.