optimize hard drop

This commit is contained in:
Adrien MALINGREY 2019-11-01 13:30:17 +01:00
parent 125ba37f2e
commit 4fe9175641

View File

@ -655,10 +655,9 @@ function hardDrop() {
scheduler.clearInterval(lockPhase) scheduler.clearInterval(lockPhase)
scheduler.clearTimeout(lockDown) scheduler.clearTimeout(lockDown)
matrix.trail.minoesPos = Array.from(matrix.piece.minoesAbsPos) matrix.trail.minoesPos = Array.from(matrix.piece.minoesAbsPos)
for (matrix.trail.height = 0; move(MOVEMENT.DOWN); matrix.trail.height++) { for (matrix.trail.height = 0; move(MOVEMENT.DOWN, matrix.piece.minoesPos, true); matrix.trail.height++) {
stats.score += 2 stats.score += 2
} }
while (move(MOVEMENT.DOWN, matrix.piece.minoesPos, true)) {}
matrix.draw() matrix.draw()
lockDown() lockDown()
scheduler.setTimeout(clearTrail, ANIMATION_DELAY) scheduler.setTimeout(clearTrail, ANIMATION_DELAY)