As I understand there was an optimization to how things are erased from old scenes (not active scenes). Considering the last sentence, I have to optimize my code. But I am not really aware of how. The shutdown event has to be called manually on custom GameObjects. But I only guess that's how to do:
class Parrot extends Phaser.GameObjects.Sprite {
constructor(config) {
super(config.scene, config.x * SCALE, config.y * SCALE, 'animals', 15);
this.scene.events.on('shutdown', this.destroy(), this); //<- is it just that?
}
}
For any explanation I would be grateful, thanks in advance!