Skip to content

add new updated sounds and go from .wav to .mp3 #107

Merged
merged 1 commit into from
May 14, 2026
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/main/java/edu/ntnu/idi/idatt2003/gruppe42/Audio/Audio.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
public enum Audio {

// Sound effects
OPEN_APP("/Audio/open_app.wav"),
CLOSE_APP("/Audio/close_app.wav"),
CLOCK("/Audio/clock.wav"),
TRANSACTION("/Audio/transaction.wav"),
OPEN_APP("/Audio/open_app.mp3"),
CLOSE_APP("/Audio/close_app.mp3"),
WARNING("/Audio/warning.mp3"),
CLOCK("/Audio/clock.mp3"),

// Background music
WORK_THEME("/Audio/work_theme.mp3"),
WEEKEND_THEME("/Audio/weekend_theme.mp3");
WEEKEND_THEME("/Audio/weekend_theme.mp3"),
GAME_OVER_THEME("/Audio/game_over_theme.mp3");

private String path;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public final class StockAppController implements AppController {
private final StockApp stockApp;
private final Player player;
private Stock currentStock;
private AudioManager audioManager = AudioManager.getInstance();

/** True while the game is on Saturday or Sunday. */
private boolean isWeekend = false;
Expand Down Expand Up @@ -76,7 +75,6 @@ public StockAppController(
});

stockApp.getConfirmButton().setOnAction(e -> {
audioManager.playSFX(Audio.TRANSACTION);
handleTransaction();
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ 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;
}
Expand All @@ -52,7 +52,7 @@ public void setGameState(GameState gameState) {
public void startGame() {
timer = new Timer(true);
final int delay = 0;
final int period = 50;
final int period = 1000; //TODO: This has to be 1000 (1 second) on release

timer.scheduleAtFixedRate(
new TimerTask() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package edu.ntnu.idi.idatt2003.gruppe42.Controller.ViewControllers;

import edu.ntnu.idi.idatt2003.gruppe42.Audio.Audio;
import edu.ntnu.idi.idatt2003.gruppe42.Audio.AudioManager;
import edu.ntnu.idi.idatt2003.gruppe42.Controller.AppControllers.AppStoreController;
import edu.ntnu.idi.idatt2003.gruppe42.Controller.AppControllers.BankAppController;
import edu.ntnu.idi.idatt2003.gruppe42.Controller.AppControllers.StockAppController;
Expand Down Expand Up @@ -59,6 +61,7 @@ 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;
Expand Down Expand Up @@ -206,6 +209,7 @@ private void showMarketClosedWarning() {

private void showWarning() {
warningApp.show();
audioManager.playSFX(Audio.WARNING);
desktopView.enterLayer(ModalLayer.WARNING);
}

Expand All @@ -216,6 +220,7 @@ private void dismissWarning() {

private void showGameOver() {
gameOverApp.show();
audioManager.playBgMusic(Audio.GAME_OVER_THEME);
desktopView.enterLayer(ModalLayer.GAME_OVER);
}

Expand Down
Binary file added src/main/resources/Audio/clock.mp3
Binary file not shown.
Binary file removed src/main/resources/Audio/clock.wav
Binary file not shown.
Binary file added src/main/resources/Audio/close_app.mp3
Binary file not shown.
Binary file removed src/main/resources/Audio/close_app.wav
Binary file not shown.
Binary file added src/main/resources/Audio/game_over_theme.mp3
Binary file not shown.
Binary file added src/main/resources/Audio/open_app.mp3
Binary file not shown.
Binary file removed src/main/resources/Audio/open_app.wav
Binary file not shown.
Binary file removed src/main/resources/Audio/transaction.wav
Binary file not shown.
Binary file added src/main/resources/Audio/warning.mp3
Binary file not shown.
Binary file removed src/main/resources/Audio/work_theme.mp3
Binary file not shown.
2 changes: 1 addition & 1 deletion src/main/resources/css/login.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

.login-root {
-fx-background-color: linear-gradient(#FF9D23, #EA5252);
-fx-background-color: linear-gradient(#C7EABB, #84B179);
}

.login-container {
Expand Down