Honestly I think posting the code would just be more confusing (my program is over 3000 lines of code long so it'd take some work to trim out only the applicable parts).
I've been trying to wrap my head around this by using a deck of cards analogy, where an array is basically a deck of cards.
So let's say I have a ship deck (array) that holds 20 cards.
I start flipping the cards over 1 at a time (for i = 1 to arraydimensions)
Let's now say that the 2nd card is "shot down" by the player and becomes a powerup.
The "player" has always been a card/object all by itself in its own stack, so it can easily be compared against any of the cards in the ship deck, including ones that have now been transformed into powerups.
But to get the other ships to be compared against the ship that is now a powerup, it seems to me that a second array is necessary.
To use the card analogy again, if in the first deck, cards 2 and 4 are "shot down", I need to somehow isolate them and then compare them against cards 1, 3 and 5 through 20.
I can't allow cards 2 and 4 to be compared against themselves in the same deck/array because that would automatically trigger a "hit detection" condition.
So now let's suppose I have a second deck of 20 blank cards.
for i = 1 to arraydimensions is basically flipping the cards over one at a time in these two decks. One deck is blank and one has data. Both decks hold 20 cards.
In the original deck, I get to card 2 with a value of 2. It is determined to be "shot down". Card 2 in the blank deck has nothing on it. I copy the value of two and hand-write it onto the second card of the blank deck.
newship(i).x = ship(i).x
So now the data has been copied. Great! But the problem here is that if I compare card 2 in both decks, the data is the same. I can't have this because it triggers a "hit detection" condition.
So after I copy the data to the blank 2 card (which now has a value of 2), I go to the original 2 card and give it a new value.
ship(i).x = -500
If we were to view the values:
newship(i).x = 2
ship(i).x = -500
So theoretically when I compare these two cards in their separate stacks, there should be no "hit detection" conflict. The values are not the same.
So now while it's fine for card 2 in the blank deck to be compared against card 2 in the original deck, I still need to get card 2 to be compared against all of the remaining cards in the original deck.
Clear as mud? No worries! Like I say this is driving me nuts trying to figure it out! :)
Take an array, isolate specific parts of that array, then compare those parts against the original array. That's essentially what I'm trying to do. How would you do that?