Win Condition

This script is used to know whether the player wins or loses.

The variables being used is the restart screen game objects, then numbers for enemies, allies and how many are dead.

At the start of the scene, it will turn the restart screen off.

If the player makes a mistake, then they can restart the scene. This function loads the active scene again.

This function checks whether all the enemies are dead. If they all are dead, it then loads in the next scene.

This function checks if all the allies are dead. If they all are dead, then the restart screen shows.

Finally, if the player just wants to skip the scene, this function will skip the level and load in the next scene.

Leave a comment

Design a site like this with WordPress.com
Get started