How do I prevent cars from appearing on top of each other in the simple 2D Car game scenario using the getIntersectingObjects(). I tried "removeObjects()" but it keeps throwing an exception


1 | if (getWorld()== null ) return ; |
1 | getWorld().removeObjects(getIntersectingObjects(Car. class )); |
1 | getWorld().removeObjects(getIntersectingObjects(Car. class )); |