Iwant to destroy overlapping actors thatare changing value at random whenever they're the same value
LordTarantor
Member, PRO Posts: 890
I have a few instance of actor one touching each other and changing colours at random. If at any time any of the actors change to a color and the one beside it is the same color, I want to be able to destroy those by touching any of them. What kind of rule should I create to make this happen?
Comments
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Here is why:
I have 46 actors in place 8 columns of 6 rows.
Every actor is changing color every few seconds. I created a rule so when there was a change in color the actor will spawn a bigger square so it would overlap with the adjacent squares. The problem is that that was to much for it. 46 actors each one spawning a square every2 to 5 second...
So I figure that If I found the way to make the squares already overlapping I wouldn't have to spawn anything.
I tried making a rule to change their name but I don't know how to make an touching or overlapping rule about it.
Why are you changing their names? You can't affect a collision rule after you've run it once. What you can do, though, is to change an actor's tag. So you might get somewhere with that.
I changed my demo so that it spawns 20 actors per second and the performance is a little sluggish. With 48 actors, depending on the complexity of their rules, you may have problems with performance.
I can't think of another way to do this but someone else may have a clever technique.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Thanks a lot
Do you know what would I have to add so if I touch one blue and let say that blue is touching 3 more blues the all 4 are destroyed?