Spinner updates and animated score percentage display.

- Added spinner RPM display. (image by @kouyang)
- Added "osu!" image for completed spinners.
- Changed spinner hit result ratios to be slightly harder.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han
2015-02-20 16:56:41 -05:00
parent e6f85e9c5c
commit 020dfbde32
6 changed files with 73 additions and 34 deletions

View File

@@ -141,7 +141,7 @@ public class Circle implements HitObject {
data.hitResult(
hitObject.getTime(), result,
hitObject.getX(), hitObject.getY(),
color, comboEnd, hitObject.getHitSoundType()
color, comboEnd, hitObject.getHitSoundType(), false
);
return true;
}
@@ -161,17 +161,17 @@ public class Circle implements HitObject {
if (overlap || trackPosition > time + hitResultOffset[GameData.HIT_50]) {
if (isAutoMod) // "auto" mod: catch any missed notes due to lag
data.hitResult(time, GameData.HIT_300, x, y, color, comboEnd, hitSound);
data.hitResult(time, GameData.HIT_300, x, y, color, comboEnd, hitSound, false);
else // no more points can be scored, so send a miss
data.hitResult(time, GameData.HIT_MISS, x, y, null, comboEnd, hitSound);
data.hitResult(time, GameData.HIT_MISS, x, y, null, comboEnd, hitSound, false);
return true;
}
// "auto" mod: send a perfect hit result
else if (isAutoMod) {
if (Math.abs(trackPosition - time) < hitResultOffset[GameData.HIT_300]) {
data.hitResult(time, GameData.HIT_300, x, y, color, comboEnd, hitSound);
data.hitResult(time, GameData.HIT_300, x, y, color, comboEnd, hitSound, false);
return true;
}
}

View File

@@ -255,10 +255,10 @@ public class Slider implements HitObject {
if (currentRepeats % 2 == 0) { // last circle
float[] lastPos = curve.pointAt(1);
data.hitResult(hitObject.getTime() + (int) sliderTimeTotal, result,
lastPos[0],lastPos[1], color, comboEnd, hitObject.getHitSoundType());
lastPos[0],lastPos[1], color, comboEnd, hitObject.getHitSoundType(), false);
} else { // first circle
data.hitResult(hitObject.getTime() + (int) sliderTimeTotal, result,
hitObject.getX(), hitObject.getY(), color, comboEnd, hitObject.getHitSoundType());
hitObject.getX(), hitObject.getY(), color, comboEnd, hitObject.getHitSoundType(), false);
}
return result;

View File

@@ -106,9 +106,6 @@ public class Spinner implements HitObject {
int timeDiff = hitObject.getTime() - trackPosition;
boolean spinnerComplete = (rotations >= rotationsNeeded);
// TODO: draw "OSU!" image after spinner ends
//GameImage.SPINNER_OSU.getImage().drawCentered(width / 2, height / 4);
// darken screen
g.setColor(Utils.COLOR_BLACK_ALPHA);
g.fillRect(0, 0, width, height);
@@ -116,6 +113,13 @@ public class Spinner implements HitObject {
if (timeDiff > 0)
return;
// rpm (TODO: make this work for Auto/Spun-Out mods)
int rpm = Math.abs(Math.round(sumVelocity / storedVelocities.length * 60));
Image rpmImg = GameImage.SPINNER_RPM.getImage();
rpmImg.drawCentered(width / 2f, height - rpmImg.getHeight() / 2f);
data.drawSymbolString(Integer.toString(rpm), (int) ((width + rpmImg.getWidth() * 0.95f) / 2f),
(int) (height - data.getScoreSymbolImage('0').getHeight() * 1.025f), 1f, true);
// spinner meter (subimage)
Image spinnerMetre = GameImage.SPINNER_METRE.getImage();
int spinnerMetreY = (spinnerComplete) ? 0 : (int) (spinnerMetre.getHeight() * (1 - (rotations / rotationsNeeded)));
@@ -138,10 +142,6 @@ public class Spinner implements HitObject {
if (extraRotations > 0)
data.drawSymbolNumber(extraRotations * 1000, width / 2, height * 2 / 3, 1.0f);
}
// TODO: add rpm meter at bottom of spinner
// TODO 2: make this work for Auto/Spun-Out mods
// int rpm = Math.abs(Math.round(sumVelocity / storedVelocities.length * 60));
}
/**
@@ -150,22 +150,21 @@ public class Spinner implements HitObject {
*/
private int hitResult() {
// TODO: verify ratios
int result;
float ratio = rotations / rotationsNeeded;
if (ratio >= 1.0f ||
GameMod.AUTO.isActive() || GameMod.SPUN_OUT.isActive()) {
result = GameData.HIT_300;
SoundController.playSound(SoundEffect.SPINNEROSU);
} else if (ratio >= 0.8f)
} else if (ratio >= 0.9f)
result = GameData.HIT_100;
else if (ratio >= 0.5f)
else if (ratio >= 0.75f)
result = GameData.HIT_50;
else
result = GameData.HIT_MISS;
data.hitResult(hitObject.getEndTime(), result, width / 2, height / 2,
Color.transparent, true, (byte) -1);
Color.transparent, true, (byte) -1, true);
return result;
}