Neballer
12-07-2005, 12:04 AM
Alright, I'm currently designing a game for one of my final projects and I've almost got it nailed down except for this code.
swf file (http://www.rgsdesign.com/carp/redlazer.swf)
for (i=1; i<=_root.count; i++) {
if (this.hitTest(_root["bt"+i])) {
_root.score += 100;
_root["bt"+i].gotoAndStop(2);
this.removeMovieClip();
}
}
This checks the hit test between the enemy ship and the lazer. It works fine, but it slows the swf way down because it is constantly checking to see if there is a hit test from 0 - ∞. I want it to check for a hit test with only the lazers on the stage. I know there is a way to do this, but don't know the code for it.
Any help would be fantastic, because after I fix that, it's pretty much down.
swf file (http://www.rgsdesign.com/carp/redlazer.swf)
for (i=1; i<=_root.count; i++) {
if (this.hitTest(_root["bt"+i])) {
_root.score += 100;
_root["bt"+i].gotoAndStop(2);
this.removeMovieClip();
}
}
This checks the hit test between the enemy ship and the lazer. It works fine, but it slows the swf way down because it is constantly checking to see if there is a hit test from 0 - ∞. I want it to check for a hit test with only the lazers on the stage. I know there is a way to do this, but don't know the code for it.
Any help would be fantastic, because after I fix that, it's pretty much down.