I didn't completely understood your question but i'll try, "how do I stop the opponents when the foe is defeated"? I assume you make your opponents in sprites, you can add an instance variable to your enemy sprite lets say HP. Make an event that check the enemy sprite's HP is below 1. ^^. You can check the shooter game examples.