Cause a click on one sprite to affect the frame of another?

Get help using Construct 2

Post » Fri Jul 10, 2015 4:53 pm

HI, basically I have a blue square sprite, on clicking it turns a random colour out of 7 sprites that I have put into that animation:

E.G. On left button clicked on Blue, set animation frame to random (6)

My question is that I have several of these tiles, and whenever any one of them is clicked I want all the tiles to change frame randomly.

How would I go about doing this?

Regards

Hassan
B
6
S
1
Posts: 32
Reputation: 476

Post » Fri Jul 10, 2015 5:30 pm

If you want all of the tiles of a certain type to behave this way, put it in family. If you have same objects but different behaviour you will need some sort of typeID to determine the different tile types.
My tutorial through development blog is at http://myconstruct2dev.blogspot.co.uk/
B
12
S
3
Posts: 221
Reputation: 1,328

Post » Sat Jul 11, 2015 12:51 am

Thanks, unfortunately I only have the free version of the software, so families is not enabled. I kinda got round it by cheating and using a while loop with UID's
B
6
S
1
Posts: 32
Reputation: 476

Post » Sat Jul 11, 2015 12:54 am

You should still use instance variables with those objects, UID's are not very reliable from what I understand.
B
21
S
11
G
6
Posts: 414
Reputation: 5,335

Post » Sat Jul 11, 2015 2:34 am

Yeah - Just figured out how to do it - Thanks!
B
6
S
1
Posts: 32
Reputation: 476


Return to How do I....?

Who is online

Users browsing this forum: Clark Thy Lord and 1 guest