From e08eadf079316e46dd7bf42db9bb311db968c91a Mon Sep 17 00:00:00 2001 From: Aidan Ross Date: Thu, 25 May 2023 11:12:56 -0400 Subject: These are zachs changes to level controller --- src/gameplay/SongPlayer.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/gameplay/SongPlayer.java') diff --git a/src/gameplay/SongPlayer.java b/src/gameplay/SongPlayer.java index d97dbd2..e8d6c7b 100644 --- a/src/gameplay/SongPlayer.java +++ b/src/gameplay/SongPlayer.java @@ -18,7 +18,8 @@ import main.Difficulty; import main.ScoreController; public class SongPlayer extends Pane { - Timer timer = new Timer(60); + private int bpm = 83; + Timer timer = new Timer(bpm); final int TIME = 1500; // delay for notes falling down the screen Score scoreCounter = new Score(); @@ -159,7 +160,7 @@ public class SongPlayer extends Pane { * @param c the color of the sent note */ public void sendNote(Queue sends, ArrayList lane, double pos, Color c) { - if (sends.peek() != null && timer.time() > sends.peek().getTime()) { + if (sends.peek() != null && timer.time() > sends.peek().getTime()-(TIME*bpm/60000)) { TranslateTransition anim = new TranslateTransition(Duration.millis(TIME)); lane.add(new Block(c, 50, 50, 5)); @@ -191,7 +192,7 @@ public class SongPlayer extends Pane { * * @param button */ - public void genButton(TButton button) { + private void genButton(TButton button) { button.heightProperty().bind(super.widthProperty().divide(8)); button.widthProperty().bind(super.widthProperty().divide(8)); button.arcHeightProperty().bind(super.widthProperty().divide(25)); -- cgit v1.2.3