Enemy hit detection problems!!

Hi all,
I have make a actor and a enemy that spawn randomly. I can kill the enemy when the actor overlaps the enemy and i press space. but i have a problem now! If two enemy's spawn near each other and the other one is infront of the other enemy. When i move the actor over the enemy actor it kills the actor behind him aswel, Thats a problem.
So what i want is that the actor only kills the enemy in front of the other enemy first!
My English is not that perfect, so i hope you guys understand.
I have make a actor and a enemy that spawn randomly. I can kill the enemy when the actor overlaps the enemy and i press space. but i have a problem now! If two enemy's spawn near each other and the other one is infront of the other enemy. When i move the actor over the enemy actor it kills the actor behind him aswel, Thats a problem.
So what i want is that the actor only kills the enemy in front of the other enemy first!
My English is not that perfect, so i hope you guys understand.
Comments
Lets call the boolean CanDestroy..now in the actor that is underneath do a rule if overlaps or collides with the actor on top change CanDestroy to false in the otherwise part of the rule change attribute CanDestroy to false.
Now when you press space bar check that CanDestroy is true.
Hope this helps.
Darren.
DeepBlueApps over 10 million hits and home of:
GS Tools
Templates
Video Tutorials
Forum
3rd party marketplace
I made a game boolean CanDestroy. In the enemy i made a rule that when overlaps and collides with the same enemy change CanDestoy to False in the otherwise part i did the same thing.
and i made a rule and change att. in the actor that when overlaps or collides with enemy change CanDestroy to true.
But it still not working!!! It still kills both enemys the one infront and the back.
I dont know what im doing wrong!
PLZZ help! Im stuck!!
Made a quick demo for you, hope it helps.
Darren.
DeepBlueApps over 10 million hits and home of:
GS Tools
Templates
Video Tutorials
Forum
3rd party marketplace
this is kind of what i mean, but instead of 2 enemy actors i have one actor!
and i would like to keep it that way.
How can i apply the same thing to one actor.
So if the same enemy actor overlaps the other same enemy actor, kill the actor infront of him first!
*The way how i kill a enemy is. a made a integer att. in the enemy actor called enemy life. So when actor overlaps enemy en space is pressed change enemy life -1. and i made a rule when enemy life is 0 destroy actor.
Darren.
Thanks for your all help! Can u help me with another problem that im having!
The enemy actor that i have grows from size +10 every 0.5 sec. and i just made another, but this one grows in size +15 every 0.5 sec.
What i want is that when the same enemys overlap eachother, that the biggst enemy in size get infront of the enemy that is smaller in size.