Hey again, i'm dealing with an issue.
I have a World called IG, which extends another one. Now, in this IG, i set levels of my game that way :
I then set functions like level3() in which i set the actors.
Now, when you play the game, some objects apperar and disappear with the getWorld().addObject(...) or removeObject(...)
The thing is, at a moment, One object appear with getWorld().addObject(megaroue);
It's not said in the IG world, it's in an actor class. Now, it's supposed to stay until level 3. That's why, in level3, I want to remove it.
Basically it should be from IG (World), something like that :
public void level3()
{
removeObject(megaroue);
}
The object class i want to remove is called Megaroue.class
But i dont know how to access this actor from the world, as it appeared through a getWorld().addObject().
public void act() { int nbrBlocs = getObjects(Bloc.class).size(); //On récupère le nombre de blocs présents dans le monde if(nbrBlocs == 0) //Si il y a plus de blocs { if(level == 1) //Si on était au niveau 1 { level = 2; //On passe au niveau 2 niveau2(); } if(level == 2) { level = 3; niveau3(); } } }