Skip to content

Commit

Permalink
Continuité de la musique entre les menus
Browse files Browse the repository at this point in the history
  • Loading branch information
PolariTOON committed Jan 24, 2020
1 parent 9679868 commit 87163b1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 18 deletions.
9 changes: 3 additions & 6 deletions src/pages/Choice.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,9 @@ public void itemSelected() {
@Override
public void enter(GameContainer container, StateBasedGame game) {
super.enter(container, game);
this.music.playAsMusic(1, .4f, true);
}

@Override
public void leave(GameContainer container, StateBasedGame game) {
this.music.stop();
if (!this.music.isPlaying()) {
this.music.playAsMusic(1, .4f, true);
}
}

}
9 changes: 3 additions & 6 deletions src/pages/Rules.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,9 @@ public void init(GameContainer container, StateBasedGame game) {

@Override
public void enter(GameContainer container, StateBasedGame game) {
this.music.playAsMusic(1, .4f, true);
}

@Override
public void leave(GameContainer container, StateBasedGame game) {
this.music.stop();
if (!this.music.isPlaying()) {
this.music.playAsMusic(1, .4f, true);
}
}

@Override
Expand Down
9 changes: 3 additions & 6 deletions src/pages/Welcome.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,9 @@ public void init(GameContainer container, StateBasedGame game) {

@Override
public void enter(GameContainer container, StateBasedGame game) {
this.music.playAsMusic(1, .4f, true);
}

@Override
public void leave(GameContainer container, StateBasedGame game) {
this.music.stop();
if (!this.music.isPlaying()) {
this.music.playAsMusic(1, .4f, true);
}
}

@Override
Expand Down

0 comments on commit 87163b1

Please sign in to comment.