3

I am developing a game in Android using AndEngine GLES-2. I am facing a problem while resetting a scene after player has completed a level. When I reset the scene, all the sprites lose their positions and tend to appear in each other's positions i.e. they swap their positions.

I have tried all the things like setting all the sprites etc. to null and calling methods like clearUpdateHandlers() and clearEventModifiers() etc. but no success yet.

I found out after a lot of googling that engineOptions.getRenderOptions().disableExtensionVertexBufferObjects(); method can fix this problem. So I am trying to invoke it but compiler gives error saying that this method in not defined for RenderOptions class.

I checked the RenderOptions class in org.andengine.engine.options package and the method really does not exist in that class. Am I missing any plug-in or is there any other problem? Please help, I am stuck.

Aviram Fireberger
  • 3,910
  • 5
  • 50
  • 69
Yogesh Somani
  • 2,624
  • 3
  • 21
  • 34

1 Answers1

1

you need to manually restart the scene, for example:

To restart a Scene you can Finish the activity and Start again but different level with SharedPreferences, or Tag's in intents, or you can set position of each Sprite and cler the Scene with:

 //detachChild this Sprites that you do not use
 Scene.detachChild(SpriteX);
 //clear the space of memory of each sprite that you do not use
 SpriteX.dispose();
 //unload the bitmaps that you do not use
 BitMapsX.unload();

this method have a seconds to run, but you can use a elegant "hud" in you game, and while charging set in the hud a logo or animation with "loading", best regards

alraza1
  • 5
  • 3
Vinicius DSL
  • 1,839
  • 1
  • 18
  • 26