Go to file
Michael Mainguy 57ffe8f689 Migrate to AudioEngineV2 and fix Meta Quest 2 controller detection
- Upgrade audio system from deprecated Sound API to AudioEngineV2
  - Use CreateAudioEngineAsync() for audio engine initialization
  - Replace new Sound() with createSoundAsync() throughout codebase
  - Track sound playing state manually (StaticSound lacks isPlaying)
  - Use volume property instead of setVolume() method
  - Use stop() instead of pause() for proper StaticSound lifecycle

- Fix controller detection for Meta Quest 2
  - Check for already-connected controllers after entering XR mode
  - Fixes issue where Quest 2 controllers only become available after enterXRAsync()
  - Maintains backward compatibility with WebXR emulator

- Improve initialization performance
  - Move RockFactory.init() to main initialization (before level select)
  - Pre-load asteroid meshes and explosion particle systems on startup
  - Level initialization now only creates asteroids, not resources

- Refactor level initialization flow
  - Level creation now happens before entering XR mode
  - Add level ready observable to track initialization completion
  - Show loading messages during asteroid creation
  - Extract loading message logic to separate module

- Add audio unlock on user interaction (button click)
- Make play() methods async to support AudioEngineV2
- Pass AudioEngineV2 instance to Ship and Level1 constructors

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-17 13:59:48 -05:00
.github/workflows update build.yml 2025-10-16 10:30:44 -05:00
public Migrate to AudioEngineV2 and fix Meta Quest 2 controller detection 2025-10-17 13:59:48 -05:00
server Initial Commit 2025-02-15 11:19:24 -06:00
src Migrate to AudioEngineV2 and fix Meta Quest 2 controller detection 2025-10-17 13:59:48 -05:00
.gitignore Initial Commit 2025-02-15 11:19:24 -06:00
index.html Add difficulty levels and upgrade BabylonJS 2025-10-17 09:05:18 -05:00
package-lock.json Add difficulty levels and upgrade BabylonJS 2025-10-17 09:05:18 -05:00
package.json Add difficulty levels and upgrade BabylonJS 2025-10-17 09:05:18 -05:00
styles.css Add difficulty levels and upgrade BabylonJS 2025-10-17 09:05:18 -05:00
tsconfig.json Initial Commit 2025-02-15 11:19:24 -06:00
vite.config.ts Add difficulty levels and upgrade BabylonJS 2025-10-17 09:05:18 -05:00