Right now I have each enemy update the instance variable upon creation.
For example, when an enemy is created, the EnemyID instance variable is set to its UID.
Now I'm not sure how I would check which enemy instances exist on the current level (since they can be destroyed). Do you have any ideas on how I could check for that?
UPDATE 1: I'm currently running a For-Each loop that (from what I think) should run through each EnemyID that is currently on the level:
<img src="http://i.imgur.com/8NIZEPf.png" border="0" />
Is this correct? Would this run through each enemy on the level? If so, then the next step is figuring out how to determine which enemy is closest to the ally ship. I have a variable called ClosestEnemy but I'm not sure how I would actually check for the closest enemy.