clearPiece

This commit is contained in:
2026-01-23 00:54:17 +01:00
parent 0956e3d6e0
commit 71945a7ade

View File

@@ -255,6 +255,10 @@ class Matrix extends MinoesTable {
matrix.table.style.setProperty('--piece-row', this.piece.center.y)
}
clearPiece(piece=this.piece, className="") {
super.drawPiece(piece, className)
}
redraw() {
for (let y=0; y<this.rows; y++) {
for (let x=0; x<this.columns; x++) {
@@ -328,7 +332,7 @@ class Tetromino {
let success = this.canMove(translation, rotation)
if (success) {
scheduler.clearTimeout(lockDown)
matrix.drawPiece(this, translation == TRANSLATION.DOWN? "trail-animation" : "")
matrix.clearPiece(this, hardDropped? "trail-animation" : "")
this.center = success.center
if (rotation) this.facing = success.facing
this.lastRotation = rotation