Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Symbol as parameter

Explorer ,
Apr 10, 2013 Apr 10, 2013

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

TOPICS
ActionScript
254
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Apr 10, 2013 Apr 10, 2013

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.

Translate
LEGEND ,
Apr 10, 2013 Apr 10, 2013
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines