[help] hit testing two different duplicated movieclips
sory to post this but the search keeps timing out.
basically i want to hit test two different duplicated movie clips, one mc is a bullet with the depth i and the other a zombie with a depth of d, i am creating them both inside a movie clip which uses counters and both of them run properly but i want to do the hit test in one if statement inside the movie clip, i have tried doing hit testing in one of the movie clips but cant seem to access the other duplited movie clip, can someone help me with this or come up with a better way of doing it as this has been bugging me for ages.
oh one other problem, the bullets are created on mouse down and not on enterframe, would that make a difference at all?
heres the code in the counter mc, its quite bad. ive taken out the hittest.
code:
onClipEvent (load) {
var count;
var maxcount=25;
var setspeed=3;
var setsize=50;
var sethealth=5;
gun=1;
d = d+100000;
}
onClipEvent (enterFrame) {
count+=1;
if (count==maxcount) {
count=0;
i = i+1;
duplicateMovieClip(_root.comet, "comet"+i, i);
_root["comet"+i]._y=-30;
_root["comet"+i]._x=random(300)+100;
_root["comet"+i].speed=random(setspeed)+1;
scale=random(setsize)+50;
_root["comet"+i]._xscale=scale;
_root["comet"+i]._yscale=scale;
_root["comet"+i].health=sethealth;
}
}
onClipEvent (mouseDown) {
if (gun==1) {
d = d+100000;
duplicateMovieClip(_root.pistol_fire, "pistol_fire"+d, d);
_root["pistol_fire"+d]._x = _root.char._x;
_root["pistol_fire"+d]._y = _root.char._y;
}
}
cheers.