feat(04-04): wire audio and speech into lesson, reward, forest, and app
- playCorrectSound() on correct keypress in letter and word exercises - playRewardSound() when reward image appears - speakText() for companion comment on reward screen - playForestElementSound() when new forest element renders - speakText() for companion greeting on forest screen Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -19,6 +19,7 @@ import { renderKeyboard, highlightKey, pressKey } from "../game/keyboard";
|
||||
import { getLevelByNumber } from "../game/levels";
|
||||
import { getLetterIntro } from "../companion/companion";
|
||||
import { getWordsForLevel } from "../game/words";
|
||||
import { playCorrectSound } from "../audio/sounds";
|
||||
|
||||
export function initWelcomeScreen(
|
||||
db: IDBDatabase,
|
||||
@@ -213,6 +214,7 @@ export function initLessonScreen(
|
||||
|
||||
if (result.correct) {
|
||||
cumulativeCorrect++;
|
||||
playCorrectSound();
|
||||
const currentEl = letterArea.querySelector(".falling-letter");
|
||||
if (currentEl) {
|
||||
currentEl.classList.add("falling-letter--dissolve");
|
||||
@@ -288,6 +290,7 @@ export function initLessonScreen(
|
||||
|
||||
if (result.correct) {
|
||||
cumulativeCorrect++;
|
||||
playCorrectSound();
|
||||
|
||||
if (result.exerciseComplete) {
|
||||
document.removeEventListener("keydown", onKeyDown);
|
||||
|
||||
Reference in New Issue
Block a user