From aaec2f9f435aacc26e8d3cab4dfbb761ca1aa751 Mon Sep 17 00:00:00 2001 From: Robert Kolner Date: Thu, 15 Mar 2012 16:36:46 +0100 Subject: [PATCH] I'm stupid. --- tetris.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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) {