Hello everyone
How to create pause/resume key using Phaser 3?
here is my code:
function create(){
this.pause = false;
this.input.enabled = true;
this.keyPause = this.scene.input.keyboard.addKey("P");
}
function update(){
if(this.keyPause.isDown){
if(this.pause){
this.pause = false;
this.scene.resume();
}else{
this.pause = true;
this.scene.pause();
}
}
}
it is scucessful to pause the game, but fail to resume the game.
Anyidea??? Thank you very much