Hey people,
I have to use the removeObject() method to remove an object of the class Car when it's hit. The class Bullet has a method to detect if it's touching a Car and to remove it when it's true. But, the getWorld().removeObject(Car.class) line throws an error. It says it expects an object as a parameter, but that Car.class is a class, and not an object. But with the canSee() method, I also use Car.class as a parameter to refer to an object of Car, and that works fine. Why can't I give the method getWorld.removeObject() method a similar parameter? getWorld().removeObject(this) in the class Car works fine, but instead of this, I have to refer to the class Car because this time the method to remove the car should come from the class Bullet. Who knows the problem?