aboutsummaryrefslogtreecommitdiff
path: root/game
diff options
context:
space:
mode:
authorJAROWMR <jarorutjes07@gmail.com>2025-01-07 14:32:43 +0100
committerJAROWMR <jarorutjes07@gmail.com>2025-01-07 14:32:43 +0100
commit2c4091f845513cee2de4aac652f9720c74789327 (patch)
treeb6c4974c9709e15650d4c6333e11168a0c3bff31 /game
parentca456c50a6a4f35832d7b9d8d1b8f5eecee0e148 (diff)
audio stopped at end of level
Diffstat (limited to 'game')
-rw-r--r--game/menus/ButtonSetMainMenuScript.cpp8
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;
}