Implementing a Game Over Screen

You need to let the player know when the game ends. This can be as simple or elaborate as you like. Some games display detailed statistics about the game, some wish you better luck next time. The game over screen is an opportunity to engage with your player and encourage them to come back for more. It should also provide an easy transition to restarting the game—you always want to encourage player engagement.

Let’s start improving the game over scenario by fixing the crash when the player dies. Open systems/combat.rs and notice that you’re deleting whatever entity died. That includes the player, and when the player ceases to exist, the Heads-Up Display system crashes when it tries to find the player’s status. ...

Get Hands-on Rust 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.