Added check for validity of rotation.
This commit is contained in:
1 parent
7cee70573c
commit
3806b6b9cd
1 file changed
+5
-2
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user