diff options
author | JAROWMR <jarorutjes07@gmail.com> | 2025-01-07 14:32:43 +0100 |
---|---|---|
committer | JAROWMR <jarorutjes07@gmail.com> | 2025-01-07 14:32:43 +0100 |
commit | 2c4091f845513cee2de4aac652f9720c74789327 (patch) | |
tree | b6c4974c9709e15650d4c6333e11168a0c3bff31 /game | |
parent | ca456c50a6a4f35832d7b9d8d1b8f5eecee0e148 (diff) |
audio stopped at end of level
Diffstat (limited to 'game')
-rw-r--r-- | game/menus/ButtonSetMainMenuScript.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/game/menus/ButtonSetMainMenuScript.cpp b/game/menus/ButtonSetMainMenuScript.cpp index 12b7256..e9232b5 100644 --- a/game/menus/ButtonSetMainMenuScript.cpp +++ b/game/menus/ButtonSetMainMenuScript.cpp @@ -1,5 +1,7 @@ #include "ButtonSetMainMenuScript.h" #include "MenusConfig.h" +#include "api/AudioSource.h" +#include "types.h" using namespace crepe; using namespace std; @@ -10,6 +12,12 @@ void ButtonSetMainMenuScript::init(){ } bool ButtonSetMainMenuScript::on_button_press(const ButtonPressEvent& e){ + RefVector<AudioSource> audios = this->get_components_by_name<AudioSource>("background_music"); + + for (AudioSource & audio : audios) { + audio.stop(); + } + this->set_next_scene(MAINMENU_SCENE); return false; } |