Recovering from Game Over

When a player has been defeated one way or another, it typically results in a Game Over screen in platformer titles, and ours is no different. If you’re developing the kind of game in which the player has the option of retrying or reloading, you’ll want to keep this Scene as succinct as possible. The longer you keep them here, the less likely it is that a player is going to feel like diving back in. Let’s give players the functionality to get back into the game now:

1. Open the Game_Over Scene.

2. Locate the GameOverScript script.

3. Open it in MonoDevelop-Unity.

Make the adjustments to the script shown in Listing 13.6.

Listing 13.6 Changes to the GameOverScript Script

public class GameOverScript ...

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.