Fixed a bug with brick being doubled.

This commit is contained in:
Robert Kolner committed 2012-11-21 18:36:13 +01:00
1 parent 434748b876
commit ac138f4369
1 file changed
+7 -1
+7 -1
View File
@@ -221,7 +221,10 @@ function TetrisGame(canvasId, linesCounterId, nextBricksCanvasId) {
}
this.integrateCurrentIntoBoard = function () {
if (this.currentBrickId == 0) {
return true;
}
var shape = this.brickShape(this.currentBrickId, this.currentBrickRot);
for (var i = 0; i < 4; i++) {
var x = this.currentBrickLoc[0]+shape[i][0];
@@ -233,6 +236,9 @@ function TetrisGame(canvasId, linesCounterId, nextBricksCanvasId) {
}
this.board[x][y] = this.bricks[this.currentBrickId];
this.currentBrickId = 0;
this.currentBrickLoc = 0;
this.currentBrickRot = 0;
}
}