This commit is contained in:
2026-03-27 01:07:52 +01:00
parent df0944f309
commit 06100377c9
2 changed files with 13 additions and 0 deletions

View File

@@ -276,6 +276,16 @@ function gameOver() {
stats.show();
playSound(gameover)
speak("Game over")
}
function speak(text) {
if (!window.speechSynthesis) return;
const utterance = new SpeechSynthesisUtterance(text);
utterance.lang = 'fr-FR';
utterance.volume = sfxVolumeRange.value;
speechSynthesis.speak(utterance);
}
window.onbeforeunload = function (event) {
@@ -344,6 +354,8 @@ sceneDiv.onwheel = function (event) {
screenRow.style.setProperty('--tZ', tZ + 'px');
};
// Skins
$.fn.select2.defaults.set("templateResult", (state) =>
state.id
? $(`<img class="preview" src="${state.id}" title="${state.text}" loading="lazy"/>`)

View File

@@ -163,6 +163,7 @@ class Stats {
}
set level(level) {
speak(`Niveau ${level}`)
this._level = level;
this.goal += level * 5;
if (level <= 20) {