In andAngine, I need to destroy the scene in andangine and recreate it in order to restart game variables and listeners and gamelogic. I am using this code:
scene.detachChildren();
scene.clearEntityModifiers();
scene.clearTouchAreas();
scene.clearUpdateHandlers();
System.gc();
thisengine.setScene(menuscene);
and then I recreate the scene
scene = new Scene();
scene.dosomestuff
thisengine.setScene(scene);
Something seems wrong when I recreate the scene for the third time. Sprites are not displayed ... distorted or something is not displayed at all. Can someone explain to me if I correctly initialize and destroy the scene?
source
share