Skip to content

Commit

Permalink
Process mouse moves even when game is paused
Browse files Browse the repository at this point in the history
  • Loading branch information
cutiful committed Mar 27, 2020
1 parent 3a58b95 commit 29b76cc
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/game.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,22 +120,18 @@ class FourInLine {
}

_mousemoveHandler(e) {
if (this.paused) return;

const column = Math.ceil(e.offsetX / (this.width / columns));
if (column !== this._selectedColumn) {
this._selectedColumn = column;
if (!this._active) return;
if (!this._active || this.paused) return;

this.draw.call(this);
}
}

_mouseleaveHandler(e) {
if (this.paused) return;

this._selectedColumn = 0;
if (!this._active) return;
if (!this._active || this.paused) return;

this.draw.call(this);
}
Expand Down

0 comments on commit 29b76cc

Please sign in to comment.