Explode Enemy with hitTest

Clean the Stage

Everything is working fine, but the enemy keeps on going, and the explosions keep on staying.

First, let's create some consequences for the enemy unlucky enough to be hit by a laser. I'm going to send enemy back to the right of the Stage, and randomize the Y position:

That should take care of enemy (you can test it if you want), now for the explosions.

Locate explosion in the Library and Edit. We'll add some static frames so the graphic stays on stage for a moment, then "delete" the copy of explosion with the removeMovieClip(this); function:

Content on this page requires a newer version of Adobe Flash Player.

Get Adobe Flash player

Great! Now test it:

Content on this page requires a newer version of Adobe Flash Player.

Get Adobe Flash player