Hi,
how can I get a list of object within a range of 40 and save these objects as a variable or something?
And then: how can I remove all these Objects?


1 | getWorld().removeObjects(getObjectsInRange( 40 )); |
1 2 3 4 5 6 7 8 9 | // at the top of the file: import java.util.List; // somewhere: List objects = getObjectsInRange( 40 ); for (Object object : objects) { if (object instanceof ClassNameToRemove) getWorld().removeObject((Actor)object); } |
1 | List objects = getObjectsInRange( 40 ); |
1 | List objects = getObjectsInRange( 40 , Blocker. class ); |
1 | getWorld().removeObjects(getObjectsInRange( 40 , Blocker. class )); |