hold
This commit is contained in:
parent
63df324e38
commit
33ba4ad0b9
15
app.js
15
app.js
@ -607,8 +607,8 @@ function clock() {
|
|||||||
timeCell.innerText = stats.time
|
timeCell.innerText = stats.time
|
||||||
}
|
}
|
||||||
|
|
||||||
function generate(piece=nextQueue.shift()) {
|
function generate(piece) {
|
||||||
matrix.piece = piece
|
matrix.piece = piece || nextQueue.shift()
|
||||||
|
|
||||||
if (matrix.piece.canMove(TRANSLATION.NONE)) {
|
if (matrix.piece.canMove(TRANSLATION.NONE)) {
|
||||||
scheduler.setInterval(fall, stats.fallPeriod)
|
scheduler.setInterval(fall, stats.fallPeriod)
|
||||||
@ -645,14 +645,9 @@ let playerActions = {
|
|||||||
matrix.piece.holdEnabled = false
|
matrix.piece.holdEnabled = false
|
||||||
matrix.piece.locked = false
|
matrix.piece.locked = false
|
||||||
matrix.piece.orientation = ORIENTATION.NORTH
|
matrix.piece.orientation = ORIENTATION.NORTH
|
||||||
if (holdQueue.piece) {
|
let piece = holdQueue.piece
|
||||||
let piece = holdQueue.piece
|
holdQueue.piece = matrix.piece
|
||||||
holdQueue.piece = matrix.piece
|
generate(piece)
|
||||||
generate(piece)
|
|
||||||
} else {
|
|
||||||
holdQueue.piece = matrix.piece
|
|
||||||
generate()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user