fix T.tSpin
This commit is contained in:
parent
dcaf1389eb
commit
47bbc83788
8
app.js
8
app.js
@ -404,14 +404,14 @@ S.prototype.minoesPosition = [
|
|||||||
|
|
||||||
class T extends Tetromino {
|
class T extends Tetromino {
|
||||||
get tSpin() {
|
get tSpin() {
|
||||||
if (matrix.piece.lastRotation) {
|
if (this.lastRotation) {
|
||||||
let [a, b, c, d] = matrix.piece.tSlots[matrix.piece.facing]
|
let [a, b, c, d] = this.tSlots[this.facing]
|
||||||
.translate(matrix.piece.center)
|
.translate(this.center)
|
||||||
.map(minoPosition => !matrix.cellIsEmpty(minoPosition))
|
.map(minoPosition => !matrix.cellIsEmpty(minoPosition))
|
||||||
if (a && b && (c || d))
|
if (a && b && (c || d))
|
||||||
return T_SPIN.T_SPIN
|
return T_SPIN.T_SPIN
|
||||||
else if (c && d && (a || b))
|
else if (c && d && (a || b))
|
||||||
return matrix.piece.rotationPoint5Used ? T_SPIN.T_SPIN : T_SPIN.MINI
|
return this.rotationPoint4Used ? T_SPIN.T_SPIN : T_SPIN.MINI
|
||||||
}
|
}
|
||||||
return T_SPIN.NONE
|
return T_SPIN.NONE
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user