Added check for validity of rotation.

This commit is contained in:
Robert Kolner committed 2012-03-13 17:56:29 +01:00
1 parent 7cee70573c
commit 3806b6b9cd
1 file changed
+5 -2
+5 -2
View File
@@ -126,8 +126,11 @@ function TetrisGame(id) {
}
this.canCurrentBrickRotate = function() {
/* TODO!! */
return true;
return this.isValidBrickLoc(
this.currentBrickId,
this.currentBrickLoc,
(this.currentBrickRot + 1) % 4
);
}
this.moveCurrentBrickHorizontally = function(dx) {