Comparing Varables?

For questions about using Classic.

Post » Sat Sep 01, 2012 8:39 pm

Hello everybody!

I want to check a variable value for an upcoming game im making. In this case the player has a health of five. I want it to be the case that when the players health is equal to zero, the player dies.

How do I check the value of a variable? Thank you!
Posts: 5
Reputation: 260

Post » Sun Sep 02, 2012 6:15 am

Hi ISaySup,

It's pretty simple- in your event sheet, when you create a condition, select the Player object and then choose the Compare Private Variable option. Then simply choose the variable you wish to compare (health or whatever your health variable is), select Less or Equal then enter 0.

Like this:

Player: Value 'Health' Less or Equal to 0
        Player: Destroy
Posts: 144
Reputation: 1,588

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests