diff options
author | Aidan Ross <aross02@fairport.org> | 2023-05-25 11:12:56 -0400 |
---|---|---|
committer | Aidan Ross <aross02@fairport.org> | 2023-05-25 11:12:56 -0400 |
commit | e08eadf079316e46dd7bf42db9bb311db968c91a (patch) | |
tree | 0168effa3d05610a0fe9ec00bcae148c6617aba4 /src/gameplay | |
parent | 414d5128c379916a50a015210e6d7caced1825f5 (diff) | |
download | NPEhero-e08eadf079316e46dd7bf42db9bb311db968c91a.tar.gz NPEhero-e08eadf079316e46dd7bf42db9bb311db968c91a.tar.bz2 NPEhero-e08eadf079316e46dd7bf42db9bb311db968c91a.zip |
These are zachs changes to level controller
Diffstat (limited to 'src/gameplay')
-rw-r--r-- | src/gameplay/SongPlayer.java | 7 |
1 files changed, 4 insertions, 3 deletions
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<NoteInfo> sends, ArrayList<Block> 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)); |