v2.1 — guide statique (pas de clignotement), voix sans 'majuscule', énonce le mot à épeler + rappel si inactif

This commit is contained in:
Poulpe
2026-06-17 17:11:19 +00:00
parent 17d64c3561
commit 29deac7a95
3 changed files with 17 additions and 14 deletions

24
game.js
View File

@@ -287,7 +287,7 @@ function recomputeFocus(announce = false) {
state.focus = f;
renderClue();
applyGuide();
if (announce && changed && f && state.cat.kind === "imagier") {
if (announce && changed && f) {
setTimeout(() => mascotSay("Écris : " + f + " ! ✏️", "happy"), 250);
}
}
@@ -313,7 +313,7 @@ function inputLetter(ch) {
state.current += ch;
renderWord(true);
sndType();
if (data.guided) say(ch, { interrupt: true }); // lit la lettre
if (data.guided) say(ch.toLowerCase(), { interrupt: true }); // lit la lettre (minuscule = pas de "majuscule")
spawnBubbles(window.innerWidth / 2, window.innerHeight * 0.32, 6);
checkWord();
recomputeFocus();
@@ -375,16 +375,18 @@ function clearHint() { document.querySelectorAll(".chip.hint").forEach(c => c.cl
function checkIdle() {
if (!state.running || state.miniGame) return;
const idle = (now() - state.lastAction) / 1000;
if (idle > 5 && !state.hintShown) {
state.hintShown = true;
const w = state.focus || state.targets.find(x => !state.found.has(x));
if (w) {
const chip = elWordList.querySelector(`.chip[data-word="${w}"]`);
if (chip) chip.classList.add("hint");
mascotSay("Essaie d'écrire " + w + " ! 💡", "happy");
if (idle > 5) {
const sinceHint = (now() - (state.lastHint || 0)) / 1000;
if (sinceHint > 6) {
state.lastHint = now();
const w = state.focus || state.targets.find(x => !state.found.has(x));
if (w) {
const chip = elWordList.querySelector(`.chip[data-word="${w}"]`);
if (chip) chip.classList.add("hint");
mascotSay("Écris : " + w + " ! 💡", "happy");
}
}
}
if (idle > 13) { mascotSet("sleep"); elSpeech.textContent = "Zzz… joue avec moi ! 😴"; elSpeech.classList.add("show"); }
}
/* ================================================================== */
@@ -555,7 +557,7 @@ function startCategory(cat) {
blinkLoop();
try { ac().resume(); } catch (e) {}
mascotSay(greeting(), "happy");
if (cat.kind === "imagier") recomputeFocus(true);
recomputeFocus(true);
}
/* ================================================================== */