Hi, i’m adding multiple objects from the same class with a type, i check in the class update method collision with my player, but once the collision is fired, it’s fired in all the objects from the same class not only the object who collided with the player :
public function Trap(x:Number=0, y:Number=0)
{
trace("door trap constructor");
super(x,y);
layer = 1;
type = "Trap";
}
in the update method :
if (_player.collide("Trap", _player.x, _player.y)) {
trace("trap has been hit");
}
Is there a way to fire collision only for the object that collided with player !