Losing Variables

This section shows how you can use variables for there to be a way to lose in your game.

In this example snippet, The code keeps checking if the sprite’s health is below 1. If it is, then the sprite says ‘Game Over!’, and stops all code running.

Another example of when you could use variables to ‘lose’ the game is having a timer variable, and ending the game if it is not complete in that time.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top