no sound if volume = 0

This commit is contained in:
Adrien MALINGREY 2023-05-16 23:36:24 +02:00
parent 2aec3e55d9
commit 2411416b01

4
app.js
View File

@ -1107,10 +1107,10 @@ function lockDown() {
let nbClearedLines = matrix.clearLines()
if (nbClearedLines == 4 || (nbClearedLines && tSpin)) {
tetrisSound.currentTime = 0
tetrisSound.play()
if (tetrisSound.volume) tetrisSound.play()
} else if (nbClearedLines || tSpin) {
lineClearSound.currentTime = 0
lineClearSound.play()
if(lineClearSound.volume) lineClearSound.play()
}
stats.lockDown(nbClearedLines, tSpin)