Hello there.
In my enemy.as file i have a code, if a bullet hits the enemy, enemy disappears. But for some reason it wont recognise my bullet.
public function bulletCollision(event:Event):void
{
if(this.hitTestObject(_r.ebullet))
{
removeEventListener(Event.ENTER_FRAME, eFrame);
removeEventListener(Event.ENTER_FRAME, bulletCollision);
parent.removeChild(this);
}
}
If i replace “ebullet” with “hero”(which is my player character) it will work, when hero touches enemy, enemy disappears, so im not sure why it wont recognise my bullet cos its the same as hero, i mean has a class name “ebullet” and library name “ebullet”.
I also have a bullet.as file where is written with hitTestObject when bullet touches the enemy it will make a splash animation.
If you need to see more of my code to detect the problem i can link for sure.
I would be in your debt if you help me.