Hey,
I want that the balls are disappearing when they touch an object. So now it works but all balls disappears when the first ball touch an object. But I want that only the one disappears that touchs the object.
Ball:
public void act()
{
setLocation(getX() + geschwindigkeit, getY());
Actor ball = this.getOneObjectAtOffset(0, 0, Ball.class);
if ((getX() == getWorld().getWidth()-1) || (getX() == getWorld().getWidth()+1) || (getX() == getWorld().getHeight()-1) || (getX() == getWorld().getHeight()+1)) {
getWorld().removeObjects(getWorld().getObjects(Ball.class));
}
}