Well somewhere I read that the more enterFrame's I use the more lag there will be.
So I am trying to make a lot of things be in 1 enterFrame, like coins.
So I need it to be so that when you hit a coin, it goes away, and you 1 point, just like it already does but so that I only need 1 enterFrame. Kind of like target objects in As3. But I don't know how to do this in as2â¦
without looking at your code of course. You will need to determine what movie clip is holding all the children. Maybe you have a hero that you add and a level_MC which contains all the enemies ground/walls whatever. "root" would be changed to level_MC
look at the trace that shows up when there is collision, it might just say "coin"
at that point you can get use name and make the function to suit
for(var i:int = 0; i < root.numChildren;i++) { if(HERO_MC.hitTestObject(root.getChildAt(i))) { var object = root.getChildAt(i); if(object is coin) { //coin function } if(object is ground) { //ground function } } }