CHAPTER 17

Images

Health Systems, Winning, and Losing the Game

The game is playable. But the player is in that strange limbo of being unable to win and unable to lose. In this chapter we will look at enabling the player to do both.

Winning will actually be very simple—if the player gets to the end of the level (at the bottom of the stairs) alive, he wins. This means that if we have a trigger down there, when the player passes through it, we can launch the “Congratulations! You Win!” level. We’ll further flesh out that tutorial with script to allow for the game to be quit or restarted.

Losing is actually a bit tougher, but allows us opportunities to ...

Get Creating Games with Unity and Maya 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.