Possible to combine movieclip instances into a variable?
Hey! I'm making a game where I have 5 items (item1_mc, item2_mc, and so on...)
I had my game have the code repeating 5 times for each item which I feel was very inefficient.
if(cat_mc.hitTestObject(item1_mc)){
score +=1;
item1_mc.remove = true;
item1_mc.x=-1000;
}
(Then the same thing for all five items)
And then:
if(score == 5){
gotoAndStop(3);
}
Is there a way I can combine my instance names into one varible so I don't have to repeat the code multiple times? Thanks!
