Compare instance variables for 2 instances of same object

Just started using Construct 2? Post your questions here

Post » Sun Mar 01, 2015 3:10 pm

Message: stricky can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
What's the simplest way to compare instance variables for 2 or more instances of the same object?

In the CAPX below, I want to destroy overlapping blocks only when they are of the same color but at the moment all overlapping blocks are destroyed regardless of color. I have seen some forum posts mention using local variables but I could use a simple example to illustrate this.

https://www.sendspace.com/file/ur8wzd
B
12
S
2
G
1
Posts: 25
Reputation: 890

Post » Sun Mar 01, 2015 4:28 pm

you need to use families to test between same objects
Image
B
58
S
13
G
6
Posts: 271
Reputation: 12,128

Post » Sun Mar 01, 2015 4:42 pm

So I would put the block sprite into 2 different families and test for overlap between families? Would I then need to create family instance variables and compare these? Appreciate if you could modify my CAPX to illustrate.
B
12
S
2
G
1
Posts: 25
Reputation: 890

Post » Sun Mar 01, 2015 5:08 pm

put the object in a family and in the event check the object and the family, with family behaviors
Image
B
58
S
13
G
6
Posts: 271
Reputation: 12,128

Post » Sun Mar 01, 2015 5:29 pm

Image
B
58
S
13
G
6
Posts: 271
Reputation: 12,128


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests