speak
This commit is contained in:
+6
-6
@@ -72,7 +72,7 @@ class Stats {
|
||||
if (level <= 20) this.fallPeriod = 1000 * Math.pow(0.8 - ((level - 1) * 0.007), level - 1)
|
||||
if (level > 15) this.lockDelay = 500 * Math.pow(0.9, level - 15)
|
||||
messagesSpan.addNewChild("div", { className: "show-level-animation", innerHTML: `<h1>NIVEAU<br/>${this.level}</h1>` })
|
||||
this.speak(`Niveau ${level}`, this.settings.sfxVolume);
|
||||
this.speak(`Niveau ${level}`);
|
||||
}
|
||||
|
||||
get level() {
|
||||
@@ -182,20 +182,20 @@ class Stats {
|
||||
}
|
||||
|
||||
/*if (this.speechSynthesisAvailable && this.settings.sfxVolume) {
|
||||
if (tSpin) this.speak(tSpin, this.settings.sfxVolume);
|
||||
if (nbClearedLines > 1) this.speak(CLEARED_LINES_NAMES[nbClearedLines], this.settings.sfxVolume);
|
||||
if (tSpin) this.speak(tSpin);
|
||||
if (nbClearedLines > 1) this.speak(CLEARED_LINES_NAMES[nbClearedLines]);
|
||||
}*/
|
||||
|
||||
this.goal -= awardedLineClears
|
||||
if (this.goal <= 0) return this.level++
|
||||
}
|
||||
|
||||
speak(text, volume=1) {
|
||||
speak(text, lang='fr-FR', volume=1) {
|
||||
if (!this.speechSynthesisAvailable) return;
|
||||
|
||||
const utterance = new SpeechSynthesisUtterance(text);
|
||||
utterance.lang = 'fr-FR';
|
||||
utterance.volume = volume;
|
||||
utterance.lang = lang;
|
||||
utterance.volume = this.settings.sfxVolume;
|
||||
speechSynthesis.speak(utterance);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -168,7 +168,7 @@ InstancedMino.prototype.materials = {
|
||||
envMap: environment,
|
||||
side: THREE.DoubleSide,
|
||||
transparent: true,
|
||||
opacity: 0.66,
|
||||
opacity: 0.8,
|
||||
roughness: 0.1,
|
||||
metalness: 0.6,
|
||||
onBeforeCompile: shader => {
|
||||
|
||||
+1
-1
@@ -79,7 +79,7 @@ export class Vortex extends THREE.Group {
|
||||
loader.load("./images/stars_space.jpg", texture => {
|
||||
texture.wrapS = THREE.MirroredRepeatWrapping
|
||||
texture.wrapT = THREE.MirroredRepeatWrapping
|
||||
texture.repeat.set(3, 6)
|
||||
texture.repeat.set(4, 6)
|
||||
this.opaqueCylinder.material.map = texture
|
||||
this.opaqueCylinder.material.map.offset.x = 5
|
||||
this.opaqueCylinder.material.blending = THREE.AdditiveBlending
|
||||
|
||||
Reference in New Issue
Block a user