Once again i am back with some problem.Now this time my question is something related to performance.Here is the deal. I am creating a simple shooting game in which you can fire any number of bullets and X number of enemies can appear.Now for collision detection i am doing looping in two ways and i wanna know which one is faster.
a)i am pushing refrences for each movieClip into Arrays.i.e every bullet created is pushed into an array and every enemy is pushed in some other array and then using for in loops to check for collision.After Collision detection both movieClips are removed and arrays are updated by removing the refrences of movieClips from arrays .
b) second way of doing this is attaching bullet movieClips into some parent mcBullet clip and Enemies into an mcEnemy MovieClip and then doing for in loops in that MovieClips.
Now the thing i wanna know is which one of this is more fast and better optimized.I hope you understand my Problem. i think second one is better as we wont hv to worry about arrays manipulation like pushing or removing. Looking forward for your FeedBack.