I’ve got a game where I need the enemys to hitTest with each other, I’m going to have copys of 3 types of enemys on the stage, instead of giving them all an instance name is it possible to hittest from the libary because I’ve given them instance names in the library of “enemya” “enemyb” “enemyc”
The code I have got didn’t work which was -
onClipEvent(enterFrame){
if(this.hitTest(_root.enemyc)){
trace("true")
}
if(this.hitTest(_root.enemyb)){
trace("true")
}
if(this.hitTest(_root.enemya)){
trace("true")
}
}
So then I tryed using a multi-dimentional array (for the first time) but I don’t think I got that right either…
onClipEvent(enterFrame){
if(this.hitTest(_root.test[0])){
trace("true")
}
}
That was on the instance of enemy.
_root.test = new Array();
_root.test[0] = [_root.enemya, _root.enemyb, _root.enemyc];
That was on the frame.
Can anyone modify or do a new code for hittesting by enemies please. Thanks in advance