From 0bfcf4e5439b29eb100b71e05f368121155373b6 Mon Sep 17 00:00:00 2001 From: heurtet Date: Fri, 14 May 2021 13:38:02 +0200 Subject: [PATCH] plus de bugs sur les musiques --- core/src/sagittarius/view/ResumeScreen.java | 8 ++++++++ core/src/sagittarius/view/SettingsScreen.java | 1 + 2 files changed, 9 insertions(+) diff --git a/core/src/sagittarius/view/ResumeScreen.java b/core/src/sagittarius/view/ResumeScreen.java index 5e5295d..5c31236 100644 --- a/core/src/sagittarius/view/ResumeScreen.java +++ b/core/src/sagittarius/view/ResumeScreen.java @@ -1,6 +1,7 @@ package sagittarius.view; import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.audio.Music; import com.badlogic.gdx.scenes.scene2d.InputEvent; import com.badlogic.gdx.scenes.scene2d.utils.ActorGestureListener; import com.kotcrab.vis.ui.VisUI; @@ -88,6 +89,13 @@ public class ResumeScreen extends BaseScreen { @Override public void tap(InputEvent event, float x, float y, int count, int button) { super.tap(event, x, y, count, button); + + if (!SagittariusGame.disableMusic){ + SagittariusGame.music.stop(); + SagittariusGame.music = Gdx.audio.newMusic(Gdx.files.internal("core/assets/sounds/music/game_music.mp3")); + SagittariusGame.music.setLooping(true); + SagittariusGame.music.play(); + } SagittariusGame.setActiveScreen( gameScreen ); } diff --git a/core/src/sagittarius/view/SettingsScreen.java b/core/src/sagittarius/view/SettingsScreen.java index c10dfc4..e7f3bac 100644 --- a/core/src/sagittarius/view/SettingsScreen.java +++ b/core/src/sagittarius/view/SettingsScreen.java @@ -73,6 +73,7 @@ public class SettingsScreen extends BaseScreen { } else if (!disableMusic.isChecked() && ! SagittariusGame.music.isPlaying()){ + SagittariusGame.music = Gdx.audio.newMusic(Gdx.files.internal("core/assets/sounds/music/resumeMenu_music.mp3")); SagittariusGame.music.play(); SagittariusGame.disableMusic = false; }