diff options
Diffstat (limited to 'game/preview/PrevPlayerSubScene.cpp')
-rw-r--r-- | game/preview/PrevPlayerSubScene.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/game/preview/PrevPlayerSubScene.cpp b/game/preview/PrevPlayerSubScene.cpp index 2403551..074cfb4 100644 --- a/game/preview/PrevPlayerSubScene.cpp +++ b/game/preview/PrevPlayerSubScene.cpp @@ -79,7 +79,8 @@ PrevPlayerSubScene::PrevPlayerSubScene(Scene & scn) { player.add_component<BoxCollider>(vec2(40, 50)); player.add_component<BehaviorScript>().set_script<PrevPlayerScript>(); - AudioSource & audio = player.add_component<AudioSource>(Asset {"asset/music/level.ogg"}); + GameObject music = scn.new_object("background_music", "background_music"); + AudioSource & audio = music.add_component<AudioSource>(Asset {"asset/music/level.ogg"}); audio.loop = true; audio.play_on_awake = true; audio.active = false; |