Skip to content

Commit 4a632ed

Browse files
author
devinb83
committed
codePaused should be set if manually called
If pause is called manually, codePaused should be set regardless of whether the game is currently paused or not. This would fix issues where a developer might not want the game to automatically resume when the screen regains focus.
1 parent ff5dda7 commit 4a632ed

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/core/Game.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -857,23 +857,23 @@ Object.defineProperty(Phaser.Game.prototype, "paused", {
857857
if (this._paused === false)
858858
{
859859
this._paused = true;
860-
this._codePaused = true;
861860
this.sound.setMute();
862861
this.time.gamePaused();
863862
this.onPause.dispatch(this);
864863
}
864+
this._codePaused = true;
865865
}
866866
else
867867
{
868868
if (this._paused)
869869
{
870870
this._paused = false;
871-
this._codePaused = false;
872871
this.input.reset();
873872
this.sound.unsetMute();
874873
this.time.gameResumed();
875874
this.onResume.dispatch(this);
876875
}
876+
this._codePaused = false;
877877
}
878878

879879
}

0 commit comments

Comments
 (0)