diff --git a/src/main/java/edu/ntnu/idi/idatt2003/gruppe42/Audio/Audio.java b/src/main/java/edu/ntnu/idi/idatt2003/gruppe42/Audio/Audio.java index 46ec455..fdc1711 100644 --- a/src/main/java/edu/ntnu/idi/idatt2003/gruppe42/Audio/Audio.java +++ b/src/main/java/edu/ntnu/idi/idatt2003/gruppe42/Audio/Audio.java @@ -5,12 +5,11 @@ public enum Audio { // Sound effects OPEN_APP("/Audio/open_app.wav", true), CLOSE_APP("/Audio/close_app.wav", true), - WARNING("/Audio/warning.wav", true), CLOCK("/Audio/clock.wav", true), // Background music - WEEKEND_THEME("/Audio/weekend_theme.mp3", false), - GAME_OVER_THEME("/Audio/game_over_theme.mp3", false); + WORK_THEME("/Audio/work_theme.mp3", false), + WEEKEND_THEME("/Audio/weekend_theme.mp3", false); private String path; private boolean isSFX; diff --git a/src/main/java/edu/ntnu/idi/idatt2003/gruppe42/Audio/AudioManager.java b/src/main/java/edu/ntnu/idi/idatt2003/gruppe42/Audio/AudioManager.java index df32d89..c828c00 100644 --- a/src/main/java/edu/ntnu/idi/idatt2003/gruppe42/Audio/AudioManager.java +++ b/src/main/java/edu/ntnu/idi/idatt2003/gruppe42/Audio/AudioManager.java @@ -51,7 +51,6 @@ public void playBgMusic(Audio audio) { stopBgMusic(); var url = getClass().getResource(audio.getPath()).toExternalForm(); bgPlayer = new MediaPlayer(new Media(url)); - bgPlayer.setCycleCount(MediaPlayer.INDEFINITE); bgPlayer.setVolume(0.5); bgPlayer.play(); } diff --git a/src/main/java/edu/ntnu/idi/idatt2003/gruppe42/Controller/GameController.java b/src/main/java/edu/ntnu/idi/idatt2003/gruppe42/Controller/GameController.java index b864f66..201c4f3 100644 --- a/src/main/java/edu/ntnu/idi/idatt2003/gruppe42/Controller/GameController.java +++ b/src/main/java/edu/ntnu/idi/idatt2003/gruppe42/Controller/GameController.java @@ -34,12 +34,12 @@ public void setGameState(GameState gameState) { this.gameState = gameState; if (gameState == GameState.WORKDAY && !workMusicPlaying) { - //audioManager.playBgMusic(Audio.WORK_THEME); + audioManager.playBgMusic(Audio.WORK_THEME); workMusicPlaying = true; weekendMusicPlaying = false; } - if ((gameState == GameState.RENTDAY || gameState == GameState.FREEDAY) && !weekendMusicPlaying) { + if ((gameState == GameState.FREEDAY) && !weekendMusicPlaying) { audioManager.playBgMusic(Audio.WEEKEND_THEME); weekendMusicPlaying = true; workMusicPlaying = false; @@ -52,7 +52,7 @@ public void setGameState(GameState gameState) { public void startGame() { timer = new Timer(true); final int delay = 0; - final int period = 10; //TODO: This has to be 1000 (1 second) on release + final int period = 1000; //TODO: This has to be 1000 (1 second) on release timer.scheduleAtFixedRate( new TimerTask() { diff --git a/src/main/java/edu/ntnu/idi/idatt2003/gruppe42/Controller/ViewControllers/DesktopViewController.java b/src/main/java/edu/ntnu/idi/idatt2003/gruppe42/Controller/ViewControllers/DesktopViewController.java index 53dc07d..0e776d9 100644 --- a/src/main/java/edu/ntnu/idi/idatt2003/gruppe42/Controller/ViewControllers/DesktopViewController.java +++ b/src/main/java/edu/ntnu/idi/idatt2003/gruppe42/Controller/ViewControllers/DesktopViewController.java @@ -62,7 +62,6 @@ public final class DesktopViewController { private final GameOverApp gameOverApp = new GameOverApp(); private Runnable onGameOver; - private AudioManager audioManager = AudioManager.getInstance(); public DesktopViewController(final Player player, final GameController gameController) { this.player = player; @@ -211,7 +210,6 @@ private void showMarketClosedWarning() { private void showWarning() { warningApp.show(); - audioManager.playSFX(Audio.WARNING); desktopView.enterLayer(ModalLayer.WARNING); } @@ -222,7 +220,6 @@ private void dismissWarning() { private void showGameOver() { gameOverApp.show(); - audioManager.playBgMusic(Audio.GAME_OVER_THEME); desktopView.enterLayer(ModalLayer.GAME_OVER); } diff --git a/src/main/resources/Audio/clock.wav b/src/main/resources/Audio/clock.wav index a8557c6..4982a98 100644 Binary files a/src/main/resources/Audio/clock.wav and b/src/main/resources/Audio/clock.wav differ diff --git a/src/main/resources/Audio/close_app.wav b/src/main/resources/Audio/close_app.wav index b1742fb..36a3a81 100644 Binary files a/src/main/resources/Audio/close_app.wav and b/src/main/resources/Audio/close_app.wav differ diff --git a/src/main/resources/Audio/game_over_theme.mp3 b/src/main/resources/Audio/game_over_theme.mp3 deleted file mode 100644 index 852324f..0000000 Binary files a/src/main/resources/Audio/game_over_theme.mp3 and /dev/null differ diff --git a/src/main/resources/Audio/open_app.wav b/src/main/resources/Audio/open_app.wav index be445ff..d788cdf 100644 Binary files a/src/main/resources/Audio/open_app.wav and b/src/main/resources/Audio/open_app.wav differ diff --git a/src/main/resources/Audio/warning.wav b/src/main/resources/Audio/warning.wav deleted file mode 100644 index 7d7d3cf..0000000 Binary files a/src/main/resources/Audio/warning.wav and /dev/null differ diff --git a/src/main/resources/Audio/weekend_theme.mp3 b/src/main/resources/Audio/weekend_theme.mp3 index 469e608..b8594bd 100644 Binary files a/src/main/resources/Audio/weekend_theme.mp3 and b/src/main/resources/Audio/weekend_theme.mp3 differ diff --git a/src/main/resources/Audio/work_theme.mp3 b/src/main/resources/Audio/work_theme.mp3 new file mode 100644 index 0000000..5d94de6 Binary files /dev/null and b/src/main/resources/Audio/work_theme.mp3 differ