fix T.tSpin

This commit is contained in:
Adrien MALINGREY 2023-05-10 09:05:24 +02:00
parent dcaf1389eb
commit 47bbc83788

8
app.js
View File

@ -404,14 +404,14 @@ S.prototype.minoesPosition = [
class T extends Tetromino {
get tSpin() {
if (matrix.piece.lastRotation) {
let [a, b, c, d] = matrix.piece.tSlots[matrix.piece.facing]
.translate(matrix.piece.center)
if (this.lastRotation) {
let [a, b, c, d] = this.tSlots[this.facing]
.translate(this.center)
.map(minoPosition => !matrix.cellIsEmpty(minoPosition))
if (a && b && (c || d))
return T_SPIN.T_SPIN
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
}