Hi dyson,
I am having a memory cleanup issue. When a game is over, and a user wants to play again, I regenerate the scenario, first removing all sprites and then re-adding them. MTE gets laggier every time they do a Play Again until my game finally dies.
This is what I am doing for cleaup:
asprite = mte.getSprites()
if asprite == nil then do return end end
for i = 1,#asprite do
if asprite[i] ~=nil then
mte.removeSprite(asprite[i], true)
end
end
for i = 1, #enemy do
if enemy[i] ~=nil and enemy[i].isdead ~= true then enemy[i]:removeSelf() end
end
enemy = nil
enemy={}
Is there something I should be doing to clean out my sprites and re-adding them? (I don’t want to unload my tile map because It is just a single level map that acts like a background canvas.
Thanks, Greg
>> In my game on each time exit, i am cleaning up mte by calling mte.cleanup(). But still my memory is keep on increasing for each game i play . More over i am manually cleaning all the objects which i am creating .
Thanks,
Kumar KS.