Is add() and remove() the right way or is it create() and recycle().
I am asking because when I have console enabled, I can see my memory go up every time I add or remove an entity.
Is add() and remove() the right way or is it create() and recycle().
I am asking because when I have console enabled, I can see my memory go up every time I add or remove an entity.
i think you can use
world.removeAll();
and then set the new world
world = new Level2();
oh did you edit your post? another question, hmm…
your memory goes up first, but flash gonna start clearing unneccessary store in memory. So, if you have no performance problem, don’t worry about that too much. But if you have “continuously” spawning entities, it’s better you use create() for them because of add + cleaning both makes more process on memory. When you use create + recycle, flash don’t need too much cleaning process in memory, so that means better performance.
Thankyou, it worked :P. I have another question but accidentally edited my thread.