I have this code in my World1 class when fly class is gone the ball class should then be removed, I looked in the documentation of the world class and there is a method in the called removeObject so why does it now work? The error says removeObject cannot be applied to given type.
if (getObjects(Fly.class).size() == 0) { removeObject(Ball.class); }