From 5675911ad9f0e250c9851ef12c5b01ee37394ce0 Mon Sep 17 00:00:00 2001 From: Aidan Ross Date: Sat, 3 Jun 2023 01:02:44 -0400 Subject: Added some menuing sounds and made the hitsounds less obnoxious --- src/gameplay/SongPlayer.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/gameplay/SongPlayer.java') diff --git a/src/gameplay/SongPlayer.java b/src/gameplay/SongPlayer.java index 983ba9c..ccd34ea 100644 --- a/src/gameplay/SongPlayer.java +++ b/src/gameplay/SongPlayer.java @@ -199,7 +199,7 @@ public class SongPlayer extends Pane { */ public void sendNote(Queue sends, ArrayList lane, TButton button) { if (sends.peek() != null && timer.time() > sends.peek().getTime()-(1000*(bpm/60000.0))) { - TranslateTransition anim = new TranslateTransition(Duration.millis(TIME+70)); + TranslateTransition anim = new TranslateTransition(Duration.millis(TIME+60)); lane.add(new Block(button.getColor(), 50, 50, 5)); int index = lane.size() - 1; @@ -255,12 +255,8 @@ public class SongPlayer extends Pane { sendNote(jSends, jLane, jButton); sendNote(kSends, kLane, kButton); if (timer.time() > songLength) { - try { - gui.Driver.setMenu(new GameOver(level, difficulty, pane, scoreCounter.getScore())); - cancel(); - } catch (UnsupportedAudioFileException | IOException | LineUnavailableException e) { - e.printStackTrace(); - } + gui.Driver.setMenu(new GameOver(level, difficulty, pane, scoreCounter.getScore())); + cancel(); } if (timer.time() > 0.0) { gui.Driver.mediaPlayer.play(); @@ -280,11 +276,12 @@ public class SongPlayer extends Pane { * @throws IOException * @throws UnsupportedAudioFileException */ - public void cancel() throws UnsupportedAudioFileException, IOException, LineUnavailableException { + public void cancel() { gameLoop.stop(); gui.Driver.mediaPlayer.stop(); Media song = new Media(Paths.get("src/assets/MenuMusicPlaceholder.wav").toUri().toString()); gui.Driver.mediaPlayer = new MediaPlayer(song); + gui.Driver.mediaPlayer.setCycleCount(Integer.MAX_VALUE); new MediaView(gui.Driver.mediaPlayer); gui.Driver.mediaPlayer.play(); } -- cgit v1.2.3