Condition for "no instances of an object"

For questions about using Classic.

Post » Tue Mar 30, 2010 8:23 pm

Hello there, what the tittle means is that Im trying to do a condition like "When all instances of 'object1' in the layout have been destroyed, you win" Is there an easy way to do it? So far Ive tough about using a global variable as the "total amount of object1 instances" and then keep track of the instances destroyed with another variable, (then, when the numbers are equal, you win) but that doesnt seem elegant

Does construct itself or any of the more veteran programmers have a way to achieve this?
B
2
G
3
Posts: 7
Reputation: 864

Post » Tue Mar 30, 2010 8:36 pm

Use the System->Compare condition with the "Sprite.Count" expression

[code:23cjhi1o]+ System: Sprite.Count Equal to 0
-> You win[/code:23cjhi1o]
B
79
S
24
G
53
Posts: 4,728
Reputation: 40,219


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 7 guests