I do:
class Scene1 extends Phaser.Scene{
constructor(){
super('Scene1');
}
preload(){
this.load.audio('game_music', 'path/filename.wav');
}
create(){
this.gameMusic = this.sound.add('game_music', {
volume: 1.0,
loop: true
});
}
}
class Scene2 extends Phaser.Scene{
constructor(){
super('Scene2');
}
preload(){
this.load.audio('game_music', 'path/filename.wav');
}
create(){
this.gameMusic = this.sound.add('game_music', {
volume: 1.0,
loop: true
});
}
}
When I do:
this.scene.start('Scene2');
this.scene.stop('Scene1');
The music plays again from beginning and doesn’t keep from the current point. I haven’t tested this, I’m just think that is this.