man, this is a total pain. the help before works only sometimes. i'm offering this preproduction fla for anyone to check out, this is only because doodler isn't online right now... prison.fla
man, this is a total pain. the help before works only sometimes. i'm offering this preproduction fla for anyone to check out, this is only because doodler isn't online right now... prison.fla
heh, whoopsy... i forgot the "this." before the hittest condition. don't i feel the perfect fool now. well, thanks anyway... you can keep the fla...
-BANE
hmm... scratch that previous hope, whenever one clip hittests successfully, one or two different ones disappear... let's try again...
-BANE
onClipEvent(unload){
/:enemcount = /:enemcount - 1
}
That's your problem there. In your other collision detection thread, I explained the problem of what would happen when, say, enemy5 died and enemy6 was still alive.
Just delete that and it'll be fine for now, but it may pose problems later.
Also, you should use this way for detecting keypresses (in a movie clip):
onClipEvent(enterFrame){
if(Key.isDown(Key.ENTER)){dowhatever;}
}
This is MUCH more responsive than the on(press) way, becausethere isn't a delay when holding down the key, and it can detect multiple keypresses.
Also, you shouldn't do hitTest with rotated objects, because it doesn't work very well. When you rotate something, it's boudning box (the perimiter around something) gets bigger, and this is what Flash uses for movieclip-movieclip collision detection, so you end up getting some hits even though it would really be a miss. To solve this you would have to either uses a more square-ular (heh) bullet (like a circle) or just use some extra fancy trigonometery to figure out if the line hits.
i couldn't have said it better myself.