Hey! I try to pause my game without using a new scene: I have buttons “continue the game” and “restart”, but when I pause the scene and bring out the buttons - they are not clickable because the scene is paused. Please, tell me how you can get around this so that everything is in one scene?
This is my code:
onPause() {
this.ui.play.on('pointerdown', () => {
this.addPause()
this.scene.pause();
})
}
addPause() {
this.pause = this.add.sprite(x, y, 'pause').setInteractive()
this.continue = this.add.sprite(x, y, 'btn1Pause').setInteractive()
this.restart = this.add.sprite(x, y, 'btn2Pause').setInteractive()
this.continue.on('pointerdown', () => {
this.scene.resume()
})
this.pause.on('pointerdown', () => {
this.scene.resume()
})
this.restart.on('pointerdown', () => {
this.scene.restart()
})
}