Jude,
Here is a very simple example, once you get more experience you will find better ways of doing it, but I wanted to make this simple for this case.
First, make sure that all of your movieclips have instance names. So, let’s assume Eggy is correct and that ban is a movieclip within hero. Make an instance name for both hero and ban. Now, since you can move back and forth already, I’m going to assume that you have an onEnterFrame function handling the arrow keys. Outside of this function make another function called detectHit (or whatever you want to name it) and put this code.
if(hero.ban.hitTest(enemy))
{
trace("dead");
}
Also remember to put “enemy” as the instance name of the enemy… since you have more than one enemy you will either have to have multiple if statements or perform a loop (if statements will be easier for you, and as long as there are not many enemies you will be fine).
So, now that you have this function you can put detectHit(); into your onEnterFrame code.
Let me know if this works for you.
|