I have enemy ships appear four at a time, however sometimes they appear on top of each other, how can I make a hitTest that will determine if objects within the same array are hitting each other, this is the way I do my hitTest:
ActionScript Code:
[LEFT][COLOR=#0000FF]for[/COLOR] [COLOR=#000000]([/COLOR][COLOR=#000000]**var**[/COLOR] enemyNum:[COLOR=#0000FF]int[/COLOR]=enemies.[COLOR=#0000FF]length[/COLOR] - [COLOR=#000080]1[/COLOR]; enemyNum >= [COLOR=#000080]0[/COLOR]; enemyNum--[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#0000FF]for[/COLOR] [COLOR=#000000]([/COLOR][COLOR=#000000]**var**[/COLOR] laserNum:[COLOR=#0000FF]int[/COLOR]=lasers.[COLOR=#0000FF]length[/COLOR] - [COLOR=#000080]1[/COLOR]; laserNum >= [COLOR=#000080]0[/COLOR]; laserNum--[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#0000FF]if[/COLOR] [COLOR=#000000]([/COLOR]enemies[COLOR=#000000][[/COLOR]enemyNum[COLOR=#000000]][/COLOR].[COLOR=#000080]hitTestObject[/COLOR][COLOR=#000000]([/COLOR]lasers[COLOR=#000000][[/COLOR]laserNum[COLOR=#000000]][/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
[/LEFT]
however this doesn’t work because the objects will end up hitting themselves