Hello,
I am new in Phaser 3 and I am trying to pause the game to intro a dialogue and the restart the game where I paused it, but it is not working, this is my code:
this.time.addEvent({
delay: 15000,
callback: function () {
this.scene.pause();
this.scene.launch(‘DialogueBoss’);
const boss = new Boss(this);
boss.setScale(2.1);
if (boss != undefined) {
this.enemies.add(boss);
}
},
callbackScope: this
});
and then in the dialogue:
dialog
.on(‘button.click’, () => {
if(this.boss){
this.scene.stop();
this.scene.resume(this.nextScene);// where nextscene is the same scene I was playing
}
this.scene.start(this.nextScene);
})
.on(‘button.over’, ()=> {
button.getElement(‘background’).setStrokeStyle(1, 0xffffff);
})
.on(‘button.out’, ()=> {
button.getElement(‘background’).setStrokeStyle();
});