Topic: Game Programming /
As3 Multiple Enemy Spawn and hitTest Arrays
Well, I’m not going to analyse it too much, but the first thing that stands out is you’re hit testing enemy against bullet, then enemy against bullet. So you’re not testing every object against each other. You need a for loop within a for loop to achieve what you’re after.
Even a for loop within a for loop can be made more efficient so that you don’t unnecessarily hit test two objects twice within the loops, but that’s a whole other story, I suggest you get the basics working first.
Hope that helps.