diff --git a/lib/src/features/game/game_play_screen.dart b/lib/src/features/game/game_play_screen.dart index f0ebdd2..893c45b 100644 --- a/lib/src/features/game/game_play_screen.dart +++ b/lib/src/features/game/game_play_screen.dart @@ -256,6 +256,9 @@ class _GamePlayScreenState extends State final taskType = state.progress.currentTask.type; final isInBattleTask = taskType == TaskType.kill; + debugPrint( + '[BGM] TaskType: $taskType, isInBattle: $isInBattleTask, currentBgm: ${audio.currentBgm}'); + // 전투 태스크 상태 결정 if (isInBattleTask) { // 전투 태스크: 보스 여부에 따라 BGM 선택 @@ -266,11 +269,15 @@ class _GamePlayScreenState extends State // 전환 시점이거나 현재 BGM이 일치하지 않으면 재생 if (!_wasInBattleTask || audio.currentBgm != expectedBgm) { + debugPrint('[BGM] Playing battle BGM: $expectedBgm'); audio.playBgm(expectedBgm); } - } else if (_wasInBattleTask || audio.currentBgm == 'battle' || audio.currentBgm == 'boss') { - // 전투 태스크 종료 또는 BGM 불일치: 마을 BGM으로 복귀 - audio.playBgm('town'); + } else { + // 비전투 태스크: 항상 마을 BGM 유지 (이미 town이면 스킵) + if (audio.currentBgm != 'town') { + debugPrint('[BGM] Playing town BGM (was: ${audio.currentBgm})'); + audio.playBgm('town'); + } } _wasInBattleTask = isInBattleTask;