diff options
author | Aidan Ross <aross02@fairport.org> | 2023-06-07 09:21:47 -0400 |
---|---|---|
committer | Aidan Ross <aross02@fairport.org> | 2023-06-07 09:21:47 -0400 |
commit | 6e9e025c72c88e113f8ba4dac1c21ffe56ba23ef (patch) | |
tree | f8784ab8e5c3dc516a6b763f956099154d9d33af /src/gameplay/SongPlayer.java | |
parent | cf071592066aed782c2c0ea962dec5eb8cd6ed2b (diff) | |
download | NPEhero-6e9e025c72c88e113f8ba4dac1c21ffe56ba23ef.tar.gz NPEhero-6e9e025c72c88e113f8ba4dac1c21ffe56ba23ef.tar.bz2 NPEhero-6e9e025c72c88e113f8ba4dac1c21ffe56ba23ef.zip |
Somehow, the linear interpolator on the note animation got lost at some point so I put that back in.
Also, I fixed a centering issue in the distanceToGoal() method that caused some perfect hits to register as good.
Diffstat (limited to '')
-rw-r--r-- | src/gameplay/SongPlayer.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gameplay/SongPlayer.java b/src/gameplay/SongPlayer.java index 6145f14..c03be58 100644 --- a/src/gameplay/SongPlayer.java +++ b/src/gameplay/SongPlayer.java @@ -204,7 +204,7 @@ public class SongPlayer extends Pane { */ public void sendNote(Queue<NoteInfo> sends, ArrayList<Block> lane, Target button) { if (sends.peek() != null && timer.time() > sends.peek().getTime()-(1000*(bpm/60000.0))) { - TranslateTransition anim = new TranslateTransition(Duration.millis(TIME+60)); + TranslateTransition anim = new TranslateTransition(Duration.millis(TIME+105)); lane.add(new Block(button.getColor(), 50, 50, 5)); int index = lane.size() - 1; @@ -217,7 +217,8 @@ public class SongPlayer extends Pane { lane.get(index).arcWidthProperty().bind(super.widthProperty().divide(25)); lane.get(index).setX(button.getLayoutX()); lane.get(index).setY(-lane.get(index).getHeight()); - anim.setByY(super.getHeight() + lane.get(index).getHeight()); + anim.setInterpolator(Interpolator.LINEAR); + anim.setByY(super.getHeight() + lane.get(index).getHeight() + 75); anim.setCycleCount(1); anim.setAutoReverse(false); anim.setNode(lane.get(lane.size() - 1)); @@ -317,7 +318,7 @@ public class SongPlayer extends Pane { * @return */ private double distanceToGoal(Block note) { - return Math.abs((super.getHeight() - note.getTranslateY()) - dButton.rect.getY()); + return Math.abs((super.getHeight() - note.getTranslateY() + note.getHeight()/2) - dButton.rect.getLayoutY()); } /** @@ -343,7 +344,7 @@ public class SongPlayer extends Pane { scoreCounter.perfect(); return 2; } - if (distance < super.getHeight() / 5) { + if (distance < super.getHeight() / 4) { ft.setFromValue(Color.CYAN); ft.play(); scoreCounter.good(); |