So I'm making a mini game for MV and I'm running into an issue with my keyListener function, I have it setup so if you hit the escape key it will pause or unpause the game and this works great, the problem is occurring when I attempt to add in TouchInput.isCancelled() as an alternate way to pause and unpause but whenever I use the right mouse key it will pause the game but will not unpause the game and continue to run the first if statement as if it never paused. Using the keyboard escape key works exactly as it should. I'll show you the function so you get a better idea of what I'm trying to do.
Scene_Catch.prototype.keyListener = function() {
if(!$gamePaused && Input.isTriggered('escape') || TouchInput.isCancelled() ){
LevelManager.createText('Paused', 72, 10, Graphics.height/3, Graphics.width, 'center' );
$gamePaused = true;
AudioManager.playSe(this._pauseSe);
console.log('Paused' + $gamePaused);
} else if($gamePaused && Input.isTriggered('escape') || TouchInput.isCancelled() ){
LevelManager.removeTextSprite();
$gamePaused = false;
AudioManager.playSe(this._unPauseSe);
console.log('Paused' + $gamePaused);
}
};
Thanks in advance for any help.
Scene_Catch.prototype.keyListener = function() {
if(!$gamePaused && Input.isTriggered('escape') || TouchInput.isCancelled() ){
LevelManager.createText('Paused', 72, 10, Graphics.height/3, Graphics.width, 'center' );
$gamePaused = true;
AudioManager.playSe(this._pauseSe);
console.log('Paused' + $gamePaused);
} else if($gamePaused && Input.isTriggered('escape') || TouchInput.isCancelled() ){
LevelManager.removeTextSprite();
$gamePaused = false;
AudioManager.playSe(this._unPauseSe);
console.log('Paused' + $gamePaused);
}
};
Thanks in advance for any help.