Corrections for 'hidden' mod

This commit is contained in:
MatteoS 2015-08-09 01:20:45 +02:00
parent d82b8188e8
commit a13ea9308d
3 changed files with 24 additions and 18 deletions

View File

@ -256,10 +256,10 @@ public class Slider implements GameObject {
if (sliderTime == 0) if (sliderTime == 0)
return; return;
if(!GameMod.HIDDEN.isActive()){ 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];
@ -267,20 +267,23 @@ public class Slider implements GameObject {
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
if (followCircleActive)
GameImage.SLIDER_FOLLOWCIRCLE.getImage().drawCentered(c[0], c[1]);
} }
// "flashlight" mod: dim the screen
if (followCircleActive && GameMod.FLASHLIGHT.isActive()) { // follow circle
float oldAlphaBlack = Utils.COLOR_BLACK_ALPHA.a; if (followCircleActive){
Utils.COLOR_BLACK_ALPHA.a = 0.75f; GameImage.SLIDER_FOLLOWCIRCLE.getImage().drawCentered(c[0], c[1]);
g.setColor(Utils.COLOR_BLACK_ALPHA);
g.fillRect(0, 0, containerWidth, containerHeight); // "flashlight" mod: dim the screen
Utils.COLOR_BLACK_ALPHA.a = oldAlphaBlack; if (GameMod.FLASHLIGHT.isActive()) {
float oldAlphaBlack = Utils.COLOR_BLACK_ALPHA.a;
Utils.COLOR_BLACK_ALPHA.a = 0.75f;
g.setColor(Utils.COLOR_BLACK_ALPHA);
g.fillRect(0, 0, containerWidth, containerHeight);
Utils.COLOR_BLACK_ALPHA.a = oldAlphaBlack;
}
} }
} }
Utils.COLOR_WHITE_FADE.a = oldAlpha; Utils.COLOR_WHITE_FADE.a = oldAlpha;

View File

@ -211,9 +211,11 @@ public class Spinner implements GameObject {
// main spinner elements // main spinner elements
float approachScale = 1 - Utils.clamp(((float) timeDiff / (hitObject.getTime() - hitObject.getEndTime())), 0f, 1f); 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);
GameImage.SPINNER_CIRCLE.getImage().drawCentered(width / 2, height / 2);
}
Image approachCircleScaled = GameImage.SPINNER_APPROACHCIRCLE.getImage().getScaledCopy(approachScale); Image approachCircleScaled = GameImage.SPINNER_APPROACHCIRCLE.getImage().getScaledCopy(approachScale);
approachCircleScaled.setAlpha(alpha); approachCircleScaled.setAlpha(alpha);
approachCircleScaled.drawCentered(width / 2, height / 2); approachCircleScaled.drawCentered(width / 2, height / 2);

View File

@ -118,6 +118,7 @@ public class Game extends BasicGameState {
private int approachTime; private int approachTime;
/** Decay of elements in hidden mod, in milliseconds. */ /** Decay of elements in hidden mod, in milliseconds. */
//TODO: figure out actual formula for decay time
private int decayTime = 800; private int decayTime = 800;
/** Time offsets for obtaining each hit result (indexed by HIT_* constants). */ /** Time offsets for obtaining each hit result (indexed by HIT_* constants). */