If a condition is true for all instances of an object

Get help using Construct 2

Post » Thu May 12, 2016 7:47 am

Looking for an 'elegant' way to write an even such that it is only executed if a certain condition is true for all existing instances of a specific object. Lets say all instances of object 'sprite' has bullet speed 0.
B
9
S
2
Posts: 16
Reputation: 570

Post » Thu May 12, 2016 10:38 am

You have the expressions sprite.count and sprite.pickedcount to compare, for this.

First you make a pick by comparisation condition. Expression will be Sprite.Bullet.Speed. Object = that Sprite.
Now it picks all those instances who's bullet speed is zero.

Now you want to know if they all have a zero speed. Just check if they are all picked.

A sub event Compare two values. Value 1 will be Sprite.PickedCount, = , value 2 will be Sprite.Count.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950


Return to How do I....?

Who is online

Users browsing this forum: Armench and 14 guests