I am currently using Phaser with Meteor and I want to destroy the game when I switch to another page. And create the game again when I go back.
But when I check Phaser.GAMES I see something like this: [Phaser.Game, Phaser.Game, Phaser.Game, Phaser.Game, Phaser.Game]
And then, the canvas gets black. I've tried setting the game variable to null, tried set to null the items inside the Phaser.GAMES but had no success.
The strange thing is, when I check the source code, it shows Phaser.GAMES[this.id] = null but it keeps the value.I checked the source code (http://ift.tt/17c3bw6) and I added the extra logic to destroy() missing from the version I am currently using (2.1.3) but it was not working either.
I tried to just hide it, but in slower machines, it just slows down the entire site keeping the game running.
I am using Phaser v2.1.3 | Pixi.js v2.0.0. Thank you for your help.
Aucun commentaire:
Enregistrer un commentaire