spinend sound
This commit is contained in:
5
app.js
5
app.js
@@ -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
BIN
audio/spinend.mp3
Normal file
Binary file not shown.
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user