diff --git a/DouShouQi_App/DouShouQi_App/Views/GameView.swift b/DouShouQi_App/DouShouQi_App/Views/GameView.swift index 080a72e..94ccb79 100644 --- a/DouShouQi_App/DouShouQi_App/Views/GameView.swift +++ b/DouShouQi_App/DouShouQi_App/Views/GameView.swift @@ -15,6 +15,12 @@ struct MainMenuView: View { TopGameBoard().frame(maxHeight: 200) SpriteView(scene: gameScene).frame(width: 950, height: 600) } + .onAppear { + MusicPlayer.shared.playBackgroundMusic(music: "TitleScreenMusic") + } + .onDisappear { + MusicPlayer.shared.stopBackgroundMusic() + } } }