spinend sound

This commit is contained in:
2026-03-27 08:32:43 +01:00
parent 81c49ed4ae
commit a4f7ba0e08
3 changed files with 8 additions and 2 deletions

5
app.js
View File

@@ -50,6 +50,7 @@ let game = {
setTimeout(() => pauseSpan.innerHTML = "2", 1000) setTimeout(() => pauseSpan.innerHTML = "2", 1000)
setTimeout(() => pauseSpan.innerHTML = "1", 2000) setTimeout(() => pauseSpan.innerHTML = "1", 2000)
setTimeout(() => { setTimeout(() => {
pauseSpan.innerHTML = ""
document.onkeydown = onkeydown document.onkeydown = onkeydown
document.onkeyup = onkeyup document.onkeyup = onkeyup
window.onblur = game.pause window.onblur = game.pause
@@ -186,9 +187,9 @@ let playerActions = {
moveRight: () => scene.playfield.piece.move(TRANSLATION.RIGHT)? scene.moveSound.play() : scene.hitSound.stop() && scene.hitSound.play(), moveRight: () => scene.playfield.piece.move(TRANSLATION.RIGHT)? scene.moveSound.play() : scene.hitSound.stop() && scene.hitSound.play(),
rotateCW: () => scene.playfield.piece.rotate(ROTATION.CW)? scene.rotateSound.stop() && scene.rotateSound.play() : scene.hitSound.stop() && scene.hitSound.play(), rotateCW: () => scene.playfield.piece.rotate(ROTATION.CW)? scene.rotateSound.stop() && scene.rotateSound.play() : scene.spinEndSound.stop() && scene.spinEndSound.play(),
rotateCCW: () => scene.playfield.piece.rotate(ROTATION.CCW)? scene.rotateSound.stop() && scene.rotateSound.play() : scene.hitSound.stop() && scene.hitSound.play(), rotateCCW: () => scene.playfield.piece.rotate(ROTATION.CCW)? scene.rotateSound.stop() && scene.rotateSound.play() : scene.spinEndSound.stop() && scene.spinEndSound.play(),
softDrop: function () { softDrop: function () {
if (scene.playfield.piece.move(TRANSLATION.DOWN)) { if (scene.playfield.piece.move(TRANSLATION.DOWN)) {

BIN
audio/spinend.mp3 Normal file

Binary file not shown.

View File

@@ -79,6 +79,11 @@ export class TetraScene extends THREE.Scene {
this.rotateSound.setBuffer(buffer) this.rotateSound.setBuffer(buffer)
this.rotateSound.setVolume(settings.sfxVolume/100) this.rotateSound.setVolume(settings.sfxVolume/100)
}.bind(this)) }.bind(this))
this.spinEndSound = new THREE.Audio(listener)
audioLoader.load('audio/spinend.mp3', function( buffer ) {
this.spinEndSound.setBuffer(buffer)
this.spinEndSound.setVolume(settings.sfxVolume/100)
}.bind(this))
this.playfield = new Playfield(loadingManager) this.playfield = new Playfield(loadingManager)
this.add(this.playfield) this.add(this.playfield)