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:
@@ -55,7 +55,7 @@ public class Circle implements HitObject {
|
||||
* @param circleSize the map's circleSize value
|
||||
*/
|
||||
public static void init(GameContainer container, float circleSize) {
|
||||
int diameter = (int) (96 - (circleSize * 8));
|
||||
int diameter = (int) (104 - (circleSize * 8));
|
||||
diameter = (int) (diameter * OsuHitObject.getXMultiplier()); // convert from Osupixels (640x480)
|
||||
GameImage.HITCIRCLE.setImage(GameImage.HITCIRCLE.getImage().getScaledCopy(diameter, diameter));
|
||||
GameImage.HITCIRCLE_OVERLAY.setImage(GameImage.HITCIRCLE_OVERLAY.getImage().getScaledCopy(diameter, diameter));
|
||||
@@ -83,15 +83,20 @@ public class Circle implements HitObject {
|
||||
int timeDiff = hitObject.getTime() - trackPosition;
|
||||
|
||||
if (timeDiff >= 0) {
|
||||
float x = hitObject.getX(), y = hitObject.getY();
|
||||
float approachScale = 1 + (timeDiff * 2f / game.getApproachTime());
|
||||
Utils.drawCentered(GameImage.APPROACHCIRCLE.getImage().getScaledCopy(approachScale), x, y, color);
|
||||
float alpha = (approachScale > 3.3f) ? 0f : 1f - (approachScale - 1f) / 2.7f;
|
||||
float oldAlpha = color.a;
|
||||
float x = hitObject.getX(), y = hitObject.getY();
|
||||
float scale = timeDiff / (float)game.getApproachTime();
|
||||
|
||||
float approachScale = 1 + scale * 3;
|
||||
color.a = 1 - scale;
|
||||
Utils.drawCentered(GameImage.APPROACHCIRCLE.getImage().getScaledCopy(approachScale), x, y, color);
|
||||
|
||||
float alpha = Utils.clamp((1 - scale) * 2, 0, 1);
|
||||
color.a = alpha;
|
||||
Utils.COLOR_WHITE_FADE.a = alpha;
|
||||
Utils.drawCentered(GameImage.HITCIRCLE_OVERLAY.getImage(), x, y, Utils.COLOR_WHITE_FADE);
|
||||
Utils.drawCentered(GameImage.HITCIRCLE.getImage(), x, y, color);
|
||||
Utils.drawCentered(GameImage.HITCIRCLE_OVERLAY.getImage(), x, y, Utils.COLOR_WHITE_FADE);
|
||||
|
||||
color.a = oldAlpha;
|
||||
Utils.COLOR_WHITE_FADE.a = 1f;
|
||||
data.drawSymbolNumber(hitObject.getComboNumber(), x, y,
|
||||
@@ -105,8 +110,7 @@ public class Circle implements HitObject {
|
||||
* @return the hit result (GameData.HIT_* constants)
|
||||
*/
|
||||
private int hitResult(int time) {
|
||||
int trackPosition = MusicController.getPosition();
|
||||
int timeDiff = Math.abs(trackPosition - time);
|
||||
int timeDiff = Math.abs(time);
|
||||
|
||||
int[] hitResultOffset = game.getHitResultOffsets();
|
||||
int result = -1;
|
||||
@@ -128,8 +132,12 @@ public class Circle implements HitObject {
|
||||
double distance = Math.hypot(hitObject.getX() - x, hitObject.getY() - y);
|
||||
int circleRadius = GameImage.HITCIRCLE.getImage().getWidth() / 2;
|
||||
if (distance < circleRadius) {
|
||||
int result = hitResult(hitObject.getTime());
|
||||
int trackPosition = MusicController.getPosition();
|
||||
int timeDiff = trackPosition - hitObject.getTime();
|
||||
int result = hitResult(timeDiff);
|
||||
|
||||
if (result > -1) {
|
||||
data.addErrorRate(hitObject.getTime(), x, y, timeDiff);
|
||||
data.hitResult(
|
||||
hitObject.getTime(), result,
|
||||
hitObject.getX(), hitObject.getY(),
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user