Hi guys! I am inches away from releasing my game but the last problem remains.
I've done a pass on the game to minimise GLOBALS, where I have them I localise them before use etc... I've double checked my array loops on onEnterFrame and made sure I'm calling as much as I can on update with self (GameScene).
My issue is that the first round runs relatively well but subsequent retries and further rounds get slower and slower. I'm nilling everything I can get my hands on (GAME, self.world, self.player, self.rt etc...) in the gameOver() but it doesn't seem to be helping.
Is there a clean-up function I can use? Do I need to transition to a different scene first? Or manually mop up every child in self.game before I move?
I'm also calling collectgarbage("collect") on init() and gameOver(), is that a bad idea?
I'm sort of stretching the framework here so I don't have a lot of room to maneuver (lots of getPixel() calls to draw on my render target) but the first scene always behaves itself, it's just the scene reset seems to be holding onto some stuff I guess.
sceneManager:changeScene(scenes, 1, SceneManager.fade, easing.linear)
is what I'm using to make the transition to another round or reload the current one.