O'Reilly logo

Learning Construct 2 by Aryadi Subagio

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Ending a game

We have done a lot of things in this chapter, and I have explained many things. I am afraid this chapter is a bit hard to understand. Don't give up, and don't stop because we are nearing the end of the chapter. Now that we have added our state-change feature, it is time to apply a losing condition to the game. There are two losing conditions in this game: when the player loses all lives and when the time runs out. To do this, we'll give default values to the global variables related to the losing conditions. We'll give three lives and start the time countdown at 60 at the start of the level, like this:

Ending a game

Then, we'll represent these values ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required