[AS2] shooting, problem with enemies
hi all,
i have been making a game where you shoot enemies, to keep it breef.
getting straight to the point, every bullet works fine, moves with other code and has the instance name of bullet2. that all works fine. the enemies are doing what i want them to do but when it comes to shooting the enemies i am stuck.
each enemy has the instance name of enemyi, i being a number added on each time an enemy is created. once this reaches 50 it goes back to 1. there can not be more that 50 enemies at once(no matter what :P). in the bullet i have this code:
for (i = 1;i < 51; i++){
if (this.hitTest(_root["enemy"+i])){
this.removeMovieClip()
"enemy"+i.romoveMovieClip()
}
}
the problem is when i test the movie the bullet senses that it has hit the first enemy, only the first enemy, but no others. also the first enemy does not delete.
thanks very much
any help is greatly appreciated.
|