Busy with phase 3, but have to wait for the timeout to reset again :(
This commit is contained in:
@@ -192,7 +192,10 @@ const Audio = {
|
||||
- Always call `osc.stop()` to free WebAudio node resources — omitting this causes a memory leak
|
||||
- The `play()` guard `if (!GameState.soundEnabled || !this.isInitialized || !this.audioContext)` covers all three failure modes: settings muted, not yet init'd, context creation failed
|
||||
</action>
|
||||
<verify>Open browser DevTools console. Load index.html. Run `console.log(typeof Audio, Audio.isInitialized)` — should print `"object" false`. Press any key. Run `console.log(Audio.isInitialized, Audio.audioContext.state)` — should print `true "running"`.</verify>
|
||||
<verify>
|
||||
Open browser DevTools console. Load index.html. Run `console.log(typeof Audio, Audio.isInitialized)` — should print `"object" false`. Press any key. Run `console.log(Audio.isInitialized, Audio.audioContext.state)` — should print `true "running"`.
|
||||
<automated>grep -c "AudioContext\|webkitAudioContext" index.html && grep -c "isInitialized" index.html && grep -c "soundEnabled" index.html && grep -c "paddleHit\|wallHit\|score" index.html</automated>
|
||||
</verify>
|
||||
<done>Audio module exists in index.html. isInitialized is false on page load. After first keypress, isInitialized is true and audioContext.state is 'running'.</done>
|
||||
</task>
|
||||
|
||||
@@ -248,6 +251,7 @@ Open index.html. Start a game (title → play → mode select → AI mode → pl
|
||||
3. Score: let a point be scored — hear a low deep thud (clearly different weight from other sounds)
|
||||
4. Sound off: go to Settings, set Sound to OFF, play a game — no sounds. Set Sound to ON — sounds return.
|
||||
5. No audio on page load (before first keypress): DevTools > Console > `Audio.audioContext` should be null before pressing any key.
|
||||
<automated>grep -c "Audio\.play('paddleHit')" index.html && grep -c "Audio\.play('wallHit')" index.html && grep -c "Audio\.play('score')" index.html</automated>
|
||||
</verify>
|
||||
<done>Audio.play('paddleHit') fires on paddle1 and paddle2 collisions. Audio.play('wallHit') fires on top and bottom wall bounces. Audio.play('score') fires on each point scored. Toggling soundEnabled via settings correctly mutes/unmutes. AudioContext is null until first keydown.</done>
|
||||
</task>
|
||||
|
||||
Reference in New Issue
Block a user