Well that's not easy.
I think therefore you need to overwrite the removeObject method in your world like this:
public void removeObject(Actor object) {
if (object instanceof ObjectA) {
((ObjectA) object).removed();
}
super.removeObject(object);
}
Instead of ObjectA you will have to use the classname of the object that you want to execute a specific code when it get's removed.
Also in this class the method removed() has to be declared.
This method will be called when the object get's removed.
What action(s) are you going to perform when the actor is removed? I ask because there may be an easier way.
The action preforming is a ''for' statement which checks how kill the enemy. The problem with that is my bullet isn't removed when it hits the enemy and this because us the "for" statement (worked fine before the statement), so I want the bullet to be removed then execute the for statement.