multiple HitTest without using iteration
A little bit long here, but very understandable.
Hi, currently I'm creating a shooting game and having problem with hitTest checking.
The game is about controlling one hero (a single Tank) and the enemies are ships which fly from left-screen to right-screen or vice versa.
I've limited the number of HOSTILE object in the screen to 50 at a time. The HOSTILE object means that object is destroyed when my Tank Gun hits it.
OK, now the problem.
In my projectile_mc (which is shot when I press mouse button), I use FOR syntax. So, for 1 to 50, I check whether the projectile hit HOSTILE object or not.
Right, now the main problem is, the SWF is running slowly when multiple projectiles are launched via multiple mouse-clicks. I understand this because each projectile makes 50 iterations which consumes a lot of processor power.
So, are there any techniques which eliminate using FOR or iteration ?
Thanks in advance.