I have a question. I made a sidescroller game with a gun. Enemys are moving from right to left en there is a actor on the left who shoots the enemys. I have made two different remove statements. One which removes the enemy if its at x= 0. And the other one removes when the bullet hits one of the enemys. Now there is a problem, I think its not possible to use remove with to different statements. I have seen something on this site about return but that also doesnt work. Can someone explain what I need to do?
This is my code for one of the enemys:
public void removeAtZero()
{
if ( getX() == 0)
{
getWorld().removeObject(this);
return;
}
}
public void removeWhenShot()
{
if ( isTouching(Kogel.class))
{
getWorld().removeObject(this);
return;
}
}
