Search the Community
Showing results for tags 'shutdown'.
-
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!
- 3 replies
-
- custom game objects
- events
-
(and 1 more)
Tagged with:
-
I guess this is not a problem if you just reload a page, but my website changes routes without reload. I have a Phaser game running on a page, when I visit another page, I noticed game is still running. I never had to think about how to destroy the game properly since now. How do I destroy a Phaser game, what callbacks are fired and what else do I have to do, to properly destroy a Phaser game.