compare instance variable of system created objec

Get help using Construct 2

Post » Tue Nov 19, 2013 8:29 pm

Hi Guys,
I have one object OBJECT1 with 4 frames. This object has one instance variable 'VarNumber' - Number
I'm creating for instances of this object on Start of layout with random SetAnimationFrame.
After all objects are created I would like to compare either animation frame value or 'VarNumber' value ? Basically see if any instance match to another.

How to do that ?

It seems that after all objects are created I can't just use OBJECT1.AnimationFrame variable as it will always be set to last created object frame. Also not sure if I can set instance variable on system create object so new instance could have own value.

Note that I cant also use trick with passing OBJECT1.AnimationFrame to global variable or to array because what if I would want to have 50 objects ? or might want to perform comparison of farms / instance variables when objects are overlapping ??

Thanks
E
B
6
S
1
G
1
Posts: 20
Reputation: 780

Post » Tue Nov 19, 2013 9:58 pm

you can use the "system --> for each" event to iterate through your created instances to find matches.
B
20
S
6
G
4
Posts: 347
Reputation: 4,451

Post » Wed Nov 20, 2013 12:11 pm


Thanks I'll try that.
But how about on collision or on overlap ? Can I compare them somehow ?

regards
E
B
6
S
1
G
1
Posts: 20
Reputation: 780

Post » Wed Nov 20, 2013 2:51 pm

You can use Families to check for collisions etc against the same object. You'll find plenty of examples of this in the forum.
ImageImageImage
B
71
S
22
G
248
Posts: 3,760
Reputation: 138,071


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo and 22 guests