Follow-up to #115: some fixes and whitespace changes.
- Hide the spinner approach circle instead of the spinner circle. - Show the slider ball. Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
parent
262fa9d4c4
commit
0909377d14
|
@ -211,8 +211,8 @@ public class Slider implements GameObject {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (GameMod.HIDDEN.isActive()) {
|
if (GameMod.HIDDEN.isActive()) {
|
||||||
float fadeOutScale = -(float)(timeDiff-game.getApproachTime())/game.getDecayTime();
|
float fadeOutScale = -(float) (timeDiff - game.getApproachTime()) / game.getDecayTime();
|
||||||
float fadeOutAlpha = Utils.clamp(1-fadeOutScale, 0, 1);
|
float fadeOutAlpha = Utils.clamp(1 - fadeOutScale, 0, 1);
|
||||||
alpha = Math.min(alpha, fadeOutAlpha);
|
alpha = Math.min(alpha, fadeOutAlpha);
|
||||||
}
|
}
|
||||||
if (sliderClickedInitial)
|
if (sliderClickedInitial)
|
||||||
|
@ -248,7 +248,7 @@ public class Slider implements GameObject {
|
||||||
|
|
||||||
if (timeDiff >= 0) {
|
if (timeDiff >= 0) {
|
||||||
// approach circle
|
// approach circle
|
||||||
if(!GameMod.HIDDEN.isActive())
|
if (!GameMod.HIDDEN.isActive())
|
||||||
GameImage.APPROACHCIRCLE.getImage().getScaledCopy(approachScale).drawCentered(x, y, color);
|
GameImage.APPROACHCIRCLE.getImage().getScaledCopy(approachScale).drawCentered(x, y, color);
|
||||||
} else {
|
} else {
|
||||||
// Since update() might not have run before drawing during a replay, the
|
// Since update() might not have run before drawing during a replay, the
|
||||||
|
@ -259,18 +259,16 @@ public class Slider implements GameObject {
|
||||||
float[] c = curve.pointAt(getT(trackPosition, false));
|
float[] c = curve.pointAt(getT(trackPosition, false));
|
||||||
float[] c2 = curve.pointAt(getT(trackPosition, false) + 0.01f);
|
float[] c2 = curve.pointAt(getT(trackPosition, false) + 0.01f);
|
||||||
|
|
||||||
if(!GameMod.HIDDEN.isActive()){
|
float t = getT(trackPosition, false);
|
||||||
float t = getT(trackPosition, false);
|
// float dis = hitObject.getPixelLength() * HitObject.getXMultiplier() * (t - (int) t);
|
||||||
// float dis = hitObject.getPixelLength() * HitObject.getXMultiplier() * (t - (int) t);
|
// Image sliderBallFrame = sliderBallImages[(int) (dis / (diameter * Math.PI) * 30) % sliderBallImages.length];
|
||||||
// Image sliderBallFrame = sliderBallImages[(int) (dis / (diameter * Math.PI) * 30) % sliderBallImages.length];
|
Image sliderBallFrame = sliderBallImages[(int) (t * sliderTime * 60 / 1000) % sliderBallImages.length];
|
||||||
Image sliderBallFrame = sliderBallImages[(int) (t * sliderTime * 60 / 1000) % sliderBallImages.length];
|
float angle = (float) (Math.atan2(c2[1] - c[1], c2[0] - c[0]) * 180 / Math.PI);
|
||||||
float angle = (float) (Math.atan2(c2[1] - c[1], c2[0] - c[0]) * 180 / Math.PI);
|
sliderBallFrame.setRotation(angle);
|
||||||
sliderBallFrame.setRotation(angle);
|
sliderBallFrame.drawCentered(c[0], c[1]);
|
||||||
sliderBallFrame.drawCentered(c[0], c[1]);
|
|
||||||
}
|
|
||||||
|
|
||||||
// follow circle
|
// follow circle
|
||||||
if (followCircleActive){
|
if (followCircleActive) {
|
||||||
GameImage.SLIDER_FOLLOWCIRCLE.getImage().drawCentered(c[0], c[1]);
|
GameImage.SLIDER_FOLLOWCIRCLE.getImage().drawCentered(c[0], c[1]);
|
||||||
|
|
||||||
// "flashlight" mod: dim the screen
|
// "flashlight" mod: dim the screen
|
||||||
|
@ -282,8 +280,6 @@ public class Slider implements GameObject {
|
||||||
Utils.COLOR_BLACK_ALPHA.a = oldAlphaBlack;
|
Utils.COLOR_BLACK_ALPHA.a = oldAlphaBlack;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils.COLOR_WHITE_FADE.a = oldAlpha;
|
Utils.COLOR_WHITE_FADE.a = oldAlpha;
|
||||||
|
|
|
@ -210,15 +210,15 @@ public class Spinner implements GameObject {
|
||||||
spinnerMetreSub.draw(0, height - spinnerMetreSub.getHeight());
|
spinnerMetreSub.draw(0, height - spinnerMetreSub.getHeight());
|
||||||
|
|
||||||
// main spinner elements
|
// main spinner elements
|
||||||
float approachScale = 1 - Utils.clamp(((float) timeDiff / (hitObject.getTime() - hitObject.getEndTime())), 0f, 1f);
|
GameImage.SPINNER_CIRCLE.getImage().setAlpha(alpha);
|
||||||
if(!GameMod.HIDDEN.isActive()){
|
GameImage.SPINNER_CIRCLE.getImage().setRotation(drawRotation * 360f);
|
||||||
GameImage.SPINNER_CIRCLE.getImage().setAlpha(alpha);
|
GameImage.SPINNER_CIRCLE.getImage().drawCentered(width / 2, height / 2);
|
||||||
GameImage.SPINNER_CIRCLE.getImage().setRotation(drawRotation * 360f);
|
if (!GameMod.HIDDEN.isActive()) {
|
||||||
GameImage.SPINNER_CIRCLE.getImage().drawCentered(width / 2, height / 2);
|
float approachScale = 1 - Utils.clamp(((float) timeDiff / (hitObject.getTime() - hitObject.getEndTime())), 0f, 1f);
|
||||||
|
Image approachCircleScaled = GameImage.SPINNER_APPROACHCIRCLE.getImage().getScaledCopy(approachScale);
|
||||||
|
approachCircleScaled.setAlpha(alpha);
|
||||||
|
approachCircleScaled.drawCentered(width / 2, height / 2);
|
||||||
}
|
}
|
||||||
Image approachCircleScaled = GameImage.SPINNER_APPROACHCIRCLE.getImage().getScaledCopy(approachScale);
|
|
||||||
approachCircleScaled.setAlpha(alpha);
|
|
||||||
approachCircleScaled.drawCentered(width / 2, height / 2);
|
|
||||||
GameImage.SPINNER_SPIN.getImage().setAlpha(alpha);
|
GameImage.SPINNER_SPIN.getImage().setAlpha(alpha);
|
||||||
GameImage.SPINNER_SPIN.getImage().drawCentered(width / 2, height * 3 / 4);
|
GameImage.SPINNER_SPIN.getImage().drawCentered(width / 2, height * 3 / 4);
|
||||||
|
|
||||||
|
|
|
@ -117,7 +117,7 @@ public class Game extends BasicGameState {
|
||||||
/** Hit object approach time, in milliseconds. */
|
/** Hit object approach time, in milliseconds. */
|
||||||
private int approachTime;
|
private int approachTime;
|
||||||
|
|
||||||
/** Decay of elements in hidden mod, in milliseconds. */
|
/** Decay time for elements in "Hidden" mod, in milliseconds. */
|
||||||
//TODO: figure out actual formula for decay time
|
//TODO: figure out actual formula for decay time
|
||||||
private int decayTime = 800;
|
private int decayTime = 800;
|
||||||
|
|
||||||
|
@ -1519,9 +1519,8 @@ public class Game extends BasicGameState {
|
||||||
*/
|
*/
|
||||||
public int getApproachTime() { return approachTime; }
|
public int getApproachTime() { return approachTime; }
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the object decay time in hidden mod, in milliseconds.
|
* Returns the object decay time in the "Hidden" mod, in milliseconds.
|
||||||
*/
|
*/
|
||||||
public int getDecayTime() { return decayTime; }
|
public int getDecayTime() { return decayTime; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user