I have a problem where if I have an actor called Marine shoot another actor called the Hydralisk who has the function to remove the marine when he reaches him it will give me all kinds of java error when the bullet reaches the Hydralisk , but if i remove the removeObject method of the Hydralisk when he reaches the marine it works just fine. Can i get some help?
Here is the code:
public void act()
{
move();
DamageTake();
DamageCause();
}
public void move()
{
move(-2);
}
public void DamageTake()
{
Actor hydralisk = getOneIntersectingObject(Bullet.class);
if(hydralisk != null)
{
World world;
world = getWorld();
world.removeObject(this);
}
}
public void DamageCause()
{
Actor marine;
marine = getOneIntersectingObject(Marine.class);
if(marine != null)
{
getWorld().removeObjects(getWorld().getObjects(Marine.class));
}
}
}

