Visual Changes

mostly personal preferences though

Larger hit circles
Circle overlay after drawing circle
Fade in approach circles
Fade in sliders (I don't think it looks that bad)
Fade out hit lighting
Hit Error Bar
 Probably need an option for this.
Miss locations(I don't know)

Reverse Slider ball rotation on repeats
This commit is contained in:
fd
2015-02-14 13:45:14 -05:00
parent 54806303f4
commit 597c4bfb19
5 changed files with 151 additions and 23 deletions

View File

@@ -98,7 +98,7 @@ public class Slider implements HitObject {
* @param osu the associated OsuFile object
*/
public static void init(GameContainer container, float circleSize, OsuFile osu) {
int diameter = (int) (96 - (circleSize * 8));
int diameter = (int) (104 - (circleSize * 8));
diameter = (int) (diameter * OsuHitObject.getXMultiplier()); // convert from Osupixels (640x480)
// slider ball
@@ -110,7 +110,7 @@ public class Slider implements HitObject {
sliderBallImages = new Image[]{ GameImage.SLIDER_BALL.getImage() };
for (int i = 0; i < sliderBallImages.length; i++)
sliderBallImages[i] = sliderBallImages[i].getScaledCopy(diameter * 118 / 128, diameter * 118 / 128);
sliderBall = new Animation(sliderBallImages, 60);
sliderBall = new Animation(sliderBallImages, 30);
GameImage.SLIDER_FOLLOWCIRCLE.setImage(GameImage.SLIDER_FOLLOWCIRCLE.getImage().getScaledCopy(diameter * 259 / 128, diameter * 259 / 128));
GameImage.REVERSEARROW.setImage(GameImage.REVERSEARROW.getImage().getScaledCopy(diameter, diameter));
@@ -143,16 +143,21 @@ public class Slider implements HitObject {
@Override
public void draw(int trackPosition, boolean currentObject, Graphics g) {
float x = hitObject.getX(), y = hitObject.getY();
int timeDiff = hitObject.getTime() - trackPosition;
float approachScale = (timeDiff >= 0) ? 1 + (timeDiff * 2f / game.getApproachTime()) : 1f;
float alpha = (approachScale > 3.3f) ? 0f : 1f - (approachScale - 1f) / 2.7f;
float oldAlpha = color.a;
float oldAlphaFade = Utils.COLOR_WHITE_FADE.a;
color.a = alpha;
float x = hitObject.getX(), y = hitObject.getY();
float scale = timeDiff / (float)game.getApproachTime();
float approachScale = 1 + scale*3 ;
float alpha = (1 - scale);//(approachScale > 3.3f) ? 0f : 1f - (approachScale - 1f) / 2.7f;
color.a = Utils.clamp(alpha* 0.5f, 0, 1);
alpha = Utils.clamp(alpha, 0, 1);
Utils.COLOR_WHITE_FADE.a = alpha;
// curve
curve.draw();
@@ -164,6 +169,8 @@ public class Slider implements HitObject {
tick.drawCentered(c[0], c[1]);
}
}
color.a = alpha;
Image hitCircleOverlay = GameImage.HITCIRCLE_OVERLAY.getImage();
Image hitCircle = GameImage.HITCIRCLE.getImage();
@@ -174,8 +181,8 @@ public class Slider implements HitObject {
Utils.drawCentered(hitCircleOverlay, endPos[0], endPos[1], Utils.COLOR_WHITE_FADE);
// start circle
Utils.drawCentered(hitCircleOverlay, x, y, Utils.COLOR_WHITE_FADE);
Utils.drawCentered(hitCircle, x, y, color);
Utils.drawCentered(hitCircleOverlay, x, y, Utils.COLOR_WHITE_FADE);
if (sliderClicked)
; // don't draw current combo number if already clicked
else
@@ -208,22 +215,29 @@ public class Slider implements HitObject {
if (timeDiff >= 0) {
// approach circle
color.a = 1 - scale;
Utils.drawCentered(GameImage.APPROACHCIRCLE.getImage().getScaledCopy(approachScale), x, y, color);
} else {
float[] c = curve.pointAt(getT(trackPosition, false));
float[] c2 = curve.pointAt(getT(trackPosition, false) + 0.01f);
// slider ball
sliderBall.updateNoDraw();//TODO ..... I can't thing of anything else
//It might be better to make your own animation class or something
//also it might be better to update the animation based on the distance traveled
Image sliderBallFrame = sliderBall.getCurrentFrame();
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)
+ (currentRepeats % 2 == 1 ? 180 : 0);
sliderBallFrame.setRotation(angle);
sliderBallFrame.drawCentered(c[0], c[1]);
// follow circle
if (followCircleActive)
GameImage.SLIDER_FOLLOWCIRCLE.getImage().drawCentered(c[0], c[1]);
}
}
/**
* Calculates the slider hit result.
@@ -275,6 +289,7 @@ public class Slider implements HitObject {
//else not a hit
if (result > -1) {
data.addErrorRate(hitObject.getTime(), x,y,trackPosition - hitObject.getTime());
sliderClicked = true;
data.sliderTickResult(hitObject.getTime(), result,
hitObject.getX(), hitObject.getY(), hitObject.getHitSoundType());