Chapter 17: Win and Lose Condition
Now that we have a basic gameplay experience, it's time to make the game end sometime, when the player wins or loses. 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 several Objects, monitoring them.
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 not only be able to create the victory and losing conditions of the ...
Get Hands-On Unity 2021 Game Development - Second 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.