Explode Enemy with hitTest

Create an Explosion

Now we'll attach a copy of the explosion we created at that the start of this project. "Explosion" is a rather long name for a MovieClip, so I'm going to assign the name "ex" and concatenate the variable exCount. I'll also set the depth level equal to exCount:

We had better declare the exCount variable while we're at it. I'm going to start exCount equal to 4000, to avoid any depth-level conflicts:

If you test it now, the explosion will appear in the top left corner of the Stage (0,0):

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

Get Adobe Flash player