diff --git a/app.js b/app.js index ed79caf..0587316 100644 --- a/app.js +++ b/app.js @@ -117,7 +117,8 @@ let game = { scheduler.clearInterval(autorepeat) scene.music.pause() - document.onkeydown = null + document.onkeydown = resumeOnKeyDown + document.onkeyup = null window.onblur = null pauseSpan.onfocus = game.resume @@ -244,6 +245,14 @@ function onkeyup(event) { } } +function resumeOnKeyDown(event) { + let key = event.key + if(playerActions[settings.action[key]] == playerActions.pause) { + event.preventDefault() + game.resume() + } +} + /* Scene */ diff --git a/jsm/TetraGUI.js b/jsm/TetraGUI.js index 3841b3f..2724ff0 100644 --- a/jsm/TetraGUI.js +++ b/jsm/TetraGUI.js @@ -44,7 +44,7 @@ export class TetraGUI extends GUI { }) loadingManager.onLoad = function() { scene.vortex.darkCylinder.material.map = darkTexture - scene.vortex.darkCylinder.material.opacity = 0.03 + scene.vortex.darkCylinder.material.opacity = 0.055 scene.vortex.colorFullCylinder.material.map = colorfullTexture scene.vortex.colorFullCylinder.material.opacity = 0.7 @@ -120,7 +120,8 @@ export class TetraGUI extends GUI { scene.hardDropSound.setVolume(volume/100) }) - if (window.location.search.includes("dev")) { + this.dev = window.location.search.includes("dev") + if (this.dev) { let dev = this.addFolder("dev") let cameraPosition = dev.addFolder("camera.position").close() cameraPosition.add(scene.camera.position, "x") diff --git a/jsm/Vortex.js b/jsm/Vortex.js index ec03eaa..2607711 100644 --- a/jsm/Vortex.js +++ b/jsm/Vortex.js @@ -27,7 +27,7 @@ export class Vortex extends THREE.Group { texture.repeat.set(1, 1) }), blending: THREE.AdditiveBlending, - opacity: 0.03 + opacity: 0.055 }) ) this.add(this.darkCylinder)