I'm stupid.
This commit is contained in:
1 parent
a498395b7f
commit
aaec2f9f43
1 file changed
+8
-5
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user