Hello guys, I'm fairly new here.
I'm developing a small survival horror game, everything seems to work dandy, apart from major lag. I think I've traced this down to the fact the code for the enemies hit detection and physics, is in the enemy itself. So when I duplicate about 50 enemies for a high level, it obviously runs in each enemy instance.
Is there a way to use a for loop or function to run through all the enemies as and when they spawn? I've tried using onLoad/onEnterFrame without much success. I can post the code if need be.
I would very much appreciate some help.