8
Win and Lose Conditions
Now that we have a basic gameplay experience, it’s time to make the game end with the outcomes of winning or losing. One common way to implement this is through separated components with the responsibility of overseeing a set of objects to detect certain situations that need to happen, such as the player life becoming 0 or all of the waves being cleared. We will implement this through the concept of managers, components that will manage and monitor several objects.
In this chapter, we will examine the following manager concepts:
- Creating object managers
- Creating game modes
- Improving our code with events
With this knowledge, you will be able to not only create the victory and lose conditions of the game, but also ...
Get Hands-On Unity 2022 Game Development - Third Edition 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.