Compare commits

..

No commits in common. "a89a60691c6154530b56f73ba28b04ae4d93d830" and "ef8ddca950173479cf3328b9574d6c8281d4c253" have entirely different histories.

3 changed files with 10 additions and 8 deletions

View File

@ -120,7 +120,7 @@ td {
} }
.locking.mino { .locking.mino {
animation: blinker 0.08s step-start infinite; animation: blinker 0.04s step-start infinite;
} }
.ghost.mino { .ghost.mino {
@ -132,10 +132,10 @@ td {
} }
@keyframes cleared-line-animation { @keyframes cleared-line-animation {
10%, 30%, 50%, 70%, 90% { 5%, 15%, 25%, 35%, 45%, 55%, 65%, 75%, 85%, 95% {
opacity: 0; opacity: 0;
} }
20%, 40%, 60%, 80% { 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90% {
opacity: 100%; opacity: 100%;
} }
} }

View File

@ -121,7 +121,7 @@ let playerActions = {
playSound(hardDropSound) playSound(hardDropSound)
while (matrix.piece.move(TRANSLATION.DOWN, ROTATION.NONE, true)) stats.score +=2 while (matrix.piece.move(TRANSLATION.DOWN, ROTATION.NONE, true)) stats.score +=2
matrix.table.classList.add("hard-dropped-table-animation") matrix.table.classList.add("hard-dropped-table-animation")
lockDown(true) lockDown()
return true return true
}, },
@ -215,10 +215,10 @@ function fall() {
matrix.piece.move(TRANSLATION.DOWN) matrix.piece.move(TRANSLATION.DOWN)
} }
function lockDown(hardDropped=false) { function lockDown() {
scheduler.clearTimeout(lockDown) scheduler.clearTimeout(lockDown)
scheduler.clearInterval(fall) scheduler.clearInterval(fall)
if (lastActionSucceded && !hardDropped) playSound(wallSound) if (lastActionSucceded) wallSound.play()
if (matrix.lock()) { if (matrix.lock()) {
let tSpin = matrix.piece.tSpin let tSpin = matrix.piece.tSpin

View File

@ -349,13 +349,15 @@ class Tetromino {
} }
matrix.drawPiece() matrix.drawPiece()
return true return true
} else if (!hardDropped && translation == TRANSLATION.DOWN) { } else if (!hardDropped) {
if (translation == TRANSLATION.DOWN) {
this.locked = true this.locked = true
if (!scheduler.timeoutTasks.has(lockDown)) if (!scheduler.timeoutTasks.has(lockDown))
scheduler.setTimeout(lockDown, stats.lockDelay) scheduler.setTimeout(lockDown, stats.lockDelay)
matrix.drawPiece() matrix.drawPiece()
} }
} }
}
rotate(rotation) { rotate(rotation) {
return this.srs[this.facing][rotation].some((translation, rotationPoint) => { return this.srs[this.facing][rotation].some((translation, rotationPoint) => {