Hi,
I have found a bug in the Phaser framework. I have a system to play different games, so I have a menu where the user can select a game and, after playing 1 minute, go back to the menu and select other game (or the same). When the user finish the game, I use "game.destroy()" to delete all content. To save memory, I'm reusing the game object and I'm saving the Phaser object in a variable, so from the second time the Phaser object is the same:
if (taskGame) {
game = taskGame;
game.state = new Phaser.StateManager(game, {
preload: preload,
create: create,
update: update
});
game.boot();
} else {
taskGame = game = new Phaser.Game(1920, 1080, Phaser.AUTO, "taskContainer", {
preload: preload,
create: create,
update: update
}, true);
}
The problem is the following, when the user plays six times everything is OK but when playing the seven I'm getting this error during the loading of the game:
I have been investigating the Phaser code and I have detected that the problem is, in the preloader, when is loading the sounds, in line 70439, game.sound.usingWebAudio is false, when the other six times is true:
Why after running destroy() and boot() six times, usingWebAudio is false? Can somebody help me?
Thanks!