Before anyone says, yes I have searched and I’ve tried various things, but to no avail.
Yes, I have another problem with my game… This time, I obviously want some sort of reaction when a projectile hits an enemy. I’ve put this bit of script on the bullet MC which removes it when it comes into contact with an enemy:
onClipEvent (enterFrame) {
if (this.hitTest(_root.enemy)) {
this.removeMovieClip();
}
}
Now I want to know what to put on the enemy in order to make it play a certain frame when it comes into contact with one of the bullets. The problem is, i don’t know what to be testing for, as each of the bullets has a seperate instance name. This is the system by which the bullets are duplicated and named:
onClipEvent (enterFrame) {
if (Key.isDown(key.SPACE)){
_root.fire = 1;
_root.i += 1;
duplicateMovieClip(_root.bullet, "bullet" + _root.i, _root.i);
}
}
What I’m thinking I need is something like :
onClipEvent (enterFrame) {
if (this.hitTest(****)) {
gotoAndPlay(Whatever);
}
}
But I have no idea what to put in place of the *'s.
Sorry for the long post. Any help appreciated.