space-game/src/environment
Michael Mainguy 48ac74977f
All checks were successful
Build / build (push) Successful in 1m30s
Refactor: Move explosion sound to ExplosionManager
Moved explosion audio management from RockFactory to ExplosionManager for better separation of concerns and synchronized audio/visual effects.

Changes:
- ExplosionManager: Added audio support with sound pooling (5 instances)
  - New initAudio() method to load explosion sounds after audio unlock
  - Sound pool prevents concurrent explosion conflicts
  - Spatial audio synchronized with visual duration (1000ms)
  - Proper SoundState checking for available sounds

- RockFactory: Simplified by delegating audio to ExplosionManager
  - Removed _explosionSound and _audioEngine properties
  - initAudio() now delegates to ExplosionManager
  - Collision callback reduced from ~60 to ~30 lines
  - Fixed disposal order to prevent double-disposal errors

Benefits:
- Fixes concurrent explosion sound bug (multiple asteroids can explode simultaneously)
- Audio/visual timing synchronized (both use config.duration)
- Cleaner code organization (all explosion effects in one place)
- Proper disposal ordering prevents runtime errors

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-11 13:47:19 -06:00
..
asteroids Refactor: Move explosion sound to ExplosionManager 2025-11-11 13:47:19 -06:00
background Refactor: Move explosion sound to ExplosionManager 2025-11-11 13:47:19 -06:00
celestial Refactor: Move explosion sound to ExplosionManager 2025-11-11 13:47:19 -06:00
stations Restructure codebase into logical subdirectories 2025-11-11 12:53:18 -06:00