onLockDown

This commit is contained in:
2023-07-10 23:31:51 +02:00
parent bf4b296ec0
commit 8279b1188f
2 changed files with 8 additions and 3 deletions

View File

@ -167,14 +167,19 @@ class Tetromino extends AbstractTetromino {
}
if (this.canMove(TRANSLATION.DOWN)) {
this.locking = false
scheduler.clearTimeout(this.onlockdown)
scheduler.clearTimeout(this.onLockDown)
} else {
scheduler.resetTimeout(this.onlockdown, this.lockDelay)
scheduler.resetTimeout(this.onLockDown, this.lockDelay)
this.locking = true
}
if (this.ghost.visible) this.updateGhost()
return true
} else {
this.locked = true
if (!scheduler.timeoutTasks.has(this.onLockDown))
scheduler.setTimeout(this.onLockDown, this.lockDelay)
}
}
rotate(rotation) {