add followcircle expand on ticks (close #49)

This commit is contained in:
yugecin 2016-11-18 00:50:20 +01:00
parent 64d1239e84
commit d3552bc3ad

View File

@ -119,6 +119,9 @@ public class Slider extends GameObject {
private int comboColorIndex; private int comboColorIndex;
private int tickExpand = 0;
private final int TICKEXPAND = 200;
/** /**
* Initializes the Slider data type with images and dimensions. * Initializes the Slider data type with images and dimensions.
* @param container the game container * @param container the game container
@ -347,7 +350,7 @@ public class Slider extends GameObject {
// follow circle // follow circle
if (followCircleActive) { 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 // "flashlight" mod: dim the screen
if (GameMod.FLASHLIGHT.isActive()) { if (GameMod.FLASHLIGHT.isActive()) {
@ -516,9 +519,17 @@ public class Slider extends GameObject {
mousePressed(mouseX, mouseY, trackPosition); mousePressed(mouseX, mouseY, trackPosition);
} }
if (tickExpand > 0) {
tickExpand -= delta;
if (tickExpand < 0) {
tickExpand = 0;
}
}
// end of slider // end of slider
if (trackPosition > hitObject.getTime() + sliderTimeTotal) { if (trackPosition > hitObject.getTime() + sliderTimeTotal) {
tickIntervals++; tickIntervals++;
tickExpand = TICKEXPAND;
// check if cursor pressed and within end circle // check if cursor pressed and within end circle
if (keyPressed || GameMod.RELAX.isActive()) { if (keyPressed || GameMod.RELAX.isActive()) {
@ -548,6 +559,7 @@ public class Slider extends GameObject {
if (Math.floor(t) > currentRepeats) { if (Math.floor(t) > currentRepeats) {
currentRepeats++; currentRepeats++;
tickIntervals++; tickIntervals++;
tickExpand = TICKEXPAND;
isNewRepeat = true; isNewRepeat = true;
} }
} }
@ -561,6 +573,7 @@ public class Slider extends GameObject {
if (t - Math.floor(t) >= ticksT[tickIndex]) { if (t - Math.floor(t) >= ticksT[tickIndex]) {
tickIntervals++; tickIntervals++;
tickIndex = (tickIndex + 1) % ticksT.length; tickIndex = (tickIndex + 1) % ticksT.length;
tickExpand = TICKEXPAND;
isNewTick = true; isNewTick = true;
} }
} }