plus de bugs sur les musiques

This commit is contained in:
heurtet 2021-05-14 13:38:02 +02:00
parent 83ff5a79fe
commit 0bfcf4e543
2 changed files with 9 additions and 0 deletions

View file

@ -1,6 +1,7 @@
package sagittarius.view; package sagittarius.view;
import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.audio.Music;
import com.badlogic.gdx.scenes.scene2d.InputEvent; import com.badlogic.gdx.scenes.scene2d.InputEvent;
import com.badlogic.gdx.scenes.scene2d.utils.ActorGestureListener; import com.badlogic.gdx.scenes.scene2d.utils.ActorGestureListener;
import com.kotcrab.vis.ui.VisUI; import com.kotcrab.vis.ui.VisUI;
@ -88,6 +89,13 @@ public class ResumeScreen extends BaseScreen {
@Override @Override
public void tap(InputEvent event, float x, float y, int count, int button) { public void tap(InputEvent event, float x, float y, int count, int button) {
super.tap(event, x, y, count, 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 ); SagittariusGame.setActiveScreen( gameScreen );
} }

View file

@ -73,6 +73,7 @@ public class SettingsScreen extends BaseScreen {
} }
else if (!disableMusic.isChecked() && ! SagittariusGame.music.isPlaying()){ 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.music.play();
SagittariusGame.disableMusic = false; SagittariusGame.disableMusic = false;
} }