Copy link to clipboard
Copied
Hey guys,
I have a function which takes two MovieClips as parameters to detect collision between two things. How could I make it so that one of the parameters is ALL the instances of a certain symbol on the stage.
So if I make 10 instances of an Enemy symbol, how would I make that function check for collision between player and enemies without typing the collision code out 10 times for each enemy instance?
Thanks
There are a few ways you could approach it. One way would be to store references to the instances in an array and then have a looping function that goes thru each element of the array one after another.
Copy link to clipboard
Copied
There are a few ways you could approach it. One way would be to store references to the instances in an array and then have a looping function that goes thru each element of the array one after another.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now