diff --git a/tetris.js b/tetris.js index d82b10e..5303635 100644 --- a/tetris.js +++ b/tetris.js @@ -39,9 +39,12 @@ function TetrisGame(id) { /**************/ /* Functions: */ /**************/ - this.drawLock = false; + this.drawLocked = false; + this.drawLock = function() { this.drawLocked = true; }; + this.drawUnlock = function() { this.drawLocked = false; }; + this.redraw = function() { - if (this.drawLock) return; + if (this.drawLocked) return; this.canvas.drawBoard(this.board); this.drawCurrentBrick(); @@ -217,12 +220,12 @@ function TetrisGame(id) { /* Fill out */ this.moveCurrentBrickDown(); - this.drawLock = true; + this.drawLock(); var filledLines = this.getFilledLines(); for (var i = 0; i < filledLines.length; i++) { - this.removeLine(filledLines[i]); + this.removeLine(filledLines[i]-1); } - this.drawLock = false; + this.drawUnlock(); this.redraw(); if (this.isGameLost) {