seekerofknowledge
09-24-2008, 06:25 AM
Hi,
In a flash game I shoot Aliens with a gun. Aliens keep dropping from the sky & I keep shooting. To make aliens disappear when hit with a bullet, i use hitTest() inside a 'if condition' and also use removeMovieClip().
I populate the bullets and aliens with two arrays namely;
newMc[] and bulletArray[].
The problem is whena a HIT is occured; the aliens wont disappear. no idea why. can somebody help. the code is in AS2:
Also pl. chk the attached .txt file
for (j in newMc)
{
_root.newMc[j]._y += 3;
if (_root.bulletArray[j].hitTest(_root.newM... {
_root.newMc[j].removeMovieClip();
}
}
In a flash game I shoot Aliens with a gun. Aliens keep dropping from the sky & I keep shooting. To make aliens disappear when hit with a bullet, i use hitTest() inside a 'if condition' and also use removeMovieClip().
I populate the bullets and aliens with two arrays namely;
newMc[] and bulletArray[].
The problem is whena a HIT is occured; the aliens wont disappear. no idea why. can somebody help. the code is in AS2:
Also pl. chk the attached .txt file
for (j in newMc)
{
_root.newMc[j]._y += 3;
if (_root.bulletArray[j].hitTest(_root.newM... {
_root.newMc[j].removeMovieClip();
}
}