From d3552bc3adfa6755a169fc2480488ecd6df4cb81 Mon Sep 17 00:00:00 2001 From: yugecin Date: Fri, 18 Nov 2016 00:50:20 +0100 Subject: [PATCH] add followcircle expand on ticks (close #49) --- src/itdelatrisu/opsu/objects/Slider.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/itdelatrisu/opsu/objects/Slider.java b/src/itdelatrisu/opsu/objects/Slider.java index 92116e78..b3980eb7 100644 --- a/src/itdelatrisu/opsu/objects/Slider.java +++ b/src/itdelatrisu/opsu/objects/Slider.java @@ -119,6 +119,9 @@ public class Slider extends GameObject { private int comboColorIndex; + private int tickExpand = 0; + private final int TICKEXPAND = 200; + /** * Initializes the Slider data type with images and dimensions. * @param container the game container @@ -347,7 +350,7 @@ public class Slider extends GameObject { // follow circle if (followCircleActive) { - GameImage.SLIDER_FOLLOWCIRCLE.getImage().drawCentered(c.x, c.y); + GameImage.SLIDER_FOLLOWCIRCLE.getImage().getScaledCopy(1f + (tickExpand / (float) TICKEXPAND) * 0.1f).drawCentered(c.x, c.y); // "flashlight" mod: dim the screen if (GameMod.FLASHLIGHT.isActive()) { @@ -516,9 +519,17 @@ public class Slider extends GameObject { mousePressed(mouseX, mouseY, trackPosition); } + if (tickExpand > 0) { + tickExpand -= delta; + if (tickExpand < 0) { + tickExpand = 0; + } + } + // end of slider if (trackPosition > hitObject.getTime() + sliderTimeTotal) { tickIntervals++; + tickExpand = TICKEXPAND; // check if cursor pressed and within end circle if (keyPressed || GameMod.RELAX.isActive()) { @@ -548,6 +559,7 @@ public class Slider extends GameObject { if (Math.floor(t) > currentRepeats) { currentRepeats++; tickIntervals++; + tickExpand = TICKEXPAND; isNewRepeat = true; } } @@ -561,6 +573,7 @@ public class Slider extends GameObject { if (t - Math.floor(t) >= ticksT[tickIndex]) { tickIntervals++; tickIndex = (tickIndex + 1) % ticksT.length; + tickExpand = TICKEXPAND; isNewTick = true; } }