Merge pull request #71 from LemonLake/lemmmyvisuals
Added hit animations, updated lighting & added InteliJ to gitignore
This commit is contained in:
commit
dda9081149
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -15,5 +15,10 @@
|
||||||
.classpath
|
.classpath
|
||||||
.project
|
.project
|
||||||
|
|
||||||
|
# IntelliJ
|
||||||
|
.idea/
|
||||||
|
*.iml
|
||||||
|
*.iws
|
||||||
|
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
/target
|
/target
|
||||||
|
|
BIN
res/lighting.png
BIN
res/lighting.png
Binary file not shown.
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 22 KiB |
Binary file not shown.
Before Width: | Height: | Size: 13 KiB |
|
@ -23,6 +23,8 @@ import itdelatrisu.opsu.audio.MusicController;
|
||||||
import itdelatrisu.opsu.audio.SoundController;
|
import itdelatrisu.opsu.audio.SoundController;
|
||||||
import itdelatrisu.opsu.audio.SoundEffect;
|
import itdelatrisu.opsu.audio.SoundEffect;
|
||||||
import itdelatrisu.opsu.downloads.Updater;
|
import itdelatrisu.opsu.downloads.Updater;
|
||||||
|
import itdelatrisu.opsu.objects.HitResultType;
|
||||||
|
import itdelatrisu.opsu.objects.curves.Curve;
|
||||||
import itdelatrisu.opsu.replay.Replay;
|
import itdelatrisu.opsu.replay.Replay;
|
||||||
import itdelatrisu.opsu.replay.ReplayFrame;
|
import itdelatrisu.opsu.replay.ReplayFrame;
|
||||||
|
|
||||||
|
@ -44,15 +46,33 @@ public class GameData {
|
||||||
/** Delta multiplier for steady HP drain. */
|
/** Delta multiplier for steady HP drain. */
|
||||||
public static final float HP_DRAIN_MULTIPLIER = 1 / 200f;
|
public static final float HP_DRAIN_MULTIPLIER = 1 / 200f;
|
||||||
|
|
||||||
|
/** Time, in milliseconds, for a hit result to remain existent. */
|
||||||
|
public static final int HITRESULT_TIME = 833;
|
||||||
|
|
||||||
/** Time, in milliseconds, for a hit result to fade. */
|
/** Time, in milliseconds, for a hit result to fade. */
|
||||||
public static final int HITRESULT_FADE_TIME = 500;
|
public static final int HITRESULT_FADE_TIME = 500;
|
||||||
|
|
||||||
|
/** Time, in milliseconds, for a hit circle to fade. */
|
||||||
|
public static final int HITCIRCLE_FADE_TIME = 300;
|
||||||
|
|
||||||
/** Duration, in milliseconds, of a combo pop effect. */
|
/** Duration, in milliseconds, of a combo pop effect. */
|
||||||
private static final int COMBO_POP_TIME = 250;
|
private static final int COMBO_POP_TIME = 250;
|
||||||
|
|
||||||
/** Time, in milliseconds, for a hit error tick to fade. */
|
/** Time, in milliseconds, for a hit error tick to fade. */
|
||||||
private static final int HIT_ERROR_FADE_TIME = 5000;
|
private static final int HIT_ERROR_FADE_TIME = 5000;
|
||||||
|
|
||||||
|
/** Size of a hit circle at the end of the hit animation. */
|
||||||
|
private static final float HITCIRCLE_ANIM_SCALE = 1.38f;
|
||||||
|
|
||||||
|
/** Size of the hit result text at the end of its animation. */
|
||||||
|
private static final float HITCIRCLE_TEXT_ANIM_SCALE = 1.28f;
|
||||||
|
|
||||||
|
/** Time, in milliseconds, for the hit result text to bounce. */
|
||||||
|
private static final int HITCIRCLE_TEXT_BOUNCE_TIME = 100;
|
||||||
|
|
||||||
|
/** Time, in milliseconds, for the hit result text to fade. */
|
||||||
|
private static final int HITCIRCLE_TEXT_FADE_TIME = 833;
|
||||||
|
|
||||||
/** Letter grades. */
|
/** Letter grades. */
|
||||||
public enum Grade {
|
public enum Grade {
|
||||||
NULL (null, null),
|
NULL (null, null),
|
||||||
|
@ -221,12 +241,15 @@ public class GameData {
|
||||||
/** Combo color. */
|
/** Combo color. */
|
||||||
public Color color;
|
public Color color;
|
||||||
|
|
||||||
/** Whether the hit object was a spinner. */
|
/** The type of the hit object. */
|
||||||
public boolean isSpinner;
|
public HitResultType hitResultType;
|
||||||
|
|
||||||
/** Alpha level (for fading out). */
|
/** Alpha level (for fading out). */
|
||||||
public float alpha = 1f;
|
public float alpha = 1f;
|
||||||
|
|
||||||
|
/** Slider curve. */
|
||||||
|
public Curve curve;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
* @param time the result's starting track position
|
* @param time the result's starting track position
|
||||||
|
@ -234,15 +257,34 @@ public class GameData {
|
||||||
* @param x the center x coordinate
|
* @param x the center x coordinate
|
||||||
* @param y the center y coordinate
|
* @param y the center y coordinate
|
||||||
* @param color the color of the hit object
|
* @param color the color of the hit object
|
||||||
* @param isSpinner whether the hit object was a spinner
|
* @param hitResultType the type of the hit object
|
||||||
*/
|
*/
|
||||||
public OsuHitObjectResult(int time, int result, float x, float y, Color color, boolean isSpinner) {
|
public OsuHitObjectResult(int time, int result, float x, float y, Color color, HitResultType hitResultType) {
|
||||||
this.time = time;
|
this.time = time;
|
||||||
this.result = result;
|
this.result = result;
|
||||||
this.x = x;
|
this.x = x;
|
||||||
this.y = y;
|
this.y = y;
|
||||||
this.color = color;
|
this.color = color;
|
||||||
this.isSpinner = isSpinner;
|
this.hitResultType = hitResultType;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
* @param time the result's starting track position
|
||||||
|
* @param result the hit result (HIT_* constants)
|
||||||
|
* @param x the center x coordinate
|
||||||
|
* @param y the center y coordinate
|
||||||
|
* @param color the color of the hit object
|
||||||
|
* @param curve the slider curve
|
||||||
|
*/
|
||||||
|
public OsuHitObjectResult(int time, int result, float x, float y, Color color, HitResultType hitResultType, Curve curve) {
|
||||||
|
this.time = time;
|
||||||
|
this.result = result;
|
||||||
|
this.x = x;
|
||||||
|
this.y = y;
|
||||||
|
this.color = color;
|
||||||
|
this.hitResultType = hitResultType;
|
||||||
|
this.curve = curve;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -822,14 +864,9 @@ public class GameData {
|
||||||
Iterator<OsuHitObjectResult> iter = hitResultList.iterator();
|
Iterator<OsuHitObjectResult> iter = hitResultList.iterator();
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
OsuHitObjectResult hitResult = iter.next();
|
OsuHitObjectResult hitResult = iter.next();
|
||||||
if (hitResult.time + HITRESULT_FADE_TIME > trackPosition) {
|
if (hitResult.time + HITRESULT_TIME > trackPosition) {
|
||||||
// hit result
|
|
||||||
hitResults[hitResult.result].setAlpha(hitResult.alpha);
|
|
||||||
hitResults[hitResult.result].drawCentered(hitResult.x, hitResult.y);
|
|
||||||
hitResults[hitResult.result].setAlpha(1f);
|
|
||||||
|
|
||||||
// spinner
|
// spinner
|
||||||
if (hitResult.isSpinner && hitResult.result != HIT_MISS) {
|
if (hitResult.hitResultType == HitResultType.SPINNER && hitResult.result != HIT_MISS) {
|
||||||
Image spinnerOsu = GameImage.SPINNER_OSU.getImage();
|
Image spinnerOsu = GameImage.SPINNER_OSU.getImage();
|
||||||
spinnerOsu.setAlpha(hitResult.alpha);
|
spinnerOsu.setAlpha(hitResult.alpha);
|
||||||
spinnerOsu.drawCentered(width / 2, height / 4);
|
spinnerOsu.drawCentered(width / 2, height / 4);
|
||||||
|
@ -839,16 +876,71 @@ public class GameData {
|
||||||
// hit lighting
|
// hit lighting
|
||||||
else if (Options.isHitLightingEnabled() && hitResult.result != HIT_MISS &&
|
else if (Options.isHitLightingEnabled() && hitResult.result != HIT_MISS &&
|
||||||
hitResult.result != HIT_SLIDER30 && hitResult.result != HIT_SLIDER10) {
|
hitResult.result != HIT_SLIDER30 && hitResult.result != HIT_SLIDER10) {
|
||||||
float scale = 1f + ((trackPosition - hitResult.time) / (float) HITRESULT_FADE_TIME);
|
// soon add particle system to reflect original game
|
||||||
Image scaledLighting = GameImage.LIGHTING.getImage().getScaledCopy(scale);
|
Image lighting = GameImage.LIGHTING.getImage();
|
||||||
Image scaledLighting1 = GameImage.LIGHTING1.getImage().getScaledCopy(scale);
|
lighting.setAlpha(hitResult.alpha);
|
||||||
scaledLighting.setAlpha(hitResult.alpha);
|
lighting.drawCentered(hitResult.x, hitResult.y, hitResult.color);
|
||||||
scaledLighting1.setAlpha(hitResult.alpha);
|
}
|
||||||
|
|
||||||
scaledLighting.draw(hitResult.x - (scaledLighting.getWidth() / 2f),
|
// hit animation
|
||||||
hitResult.y - (scaledLighting.getHeight() / 2f), hitResult.color);
|
if (hitResult.hitResultType == HitResultType.CIRCLE
|
||||||
scaledLighting1.draw(hitResult.x - (scaledLighting1.getWidth() / 2f),
|
|| hitResult.hitResultType == HitResultType.SLIDEREND
|
||||||
hitResult.y - (scaledLighting1.getHeight() / 2f), hitResult.color);
|
|| hitResult.hitResultType == HitResultType.SLIDEREND_FIRSTOBJECT) {
|
||||||
|
float scale = Utils.easeOut(
|
||||||
|
Utils.clamp(trackPosition - hitResult.time, 0, HITCIRCLE_FADE_TIME),
|
||||||
|
1f,
|
||||||
|
HITCIRCLE_ANIM_SCALE-1f,
|
||||||
|
HITCIRCLE_FADE_TIME
|
||||||
|
);
|
||||||
|
|
||||||
|
float alpha = Utils.easeOut(
|
||||||
|
Utils.clamp(trackPosition - hitResult.time, 0, HITCIRCLE_FADE_TIME),
|
||||||
|
1f,
|
||||||
|
-1f,
|
||||||
|
HITCIRCLE_FADE_TIME
|
||||||
|
);
|
||||||
|
|
||||||
|
if (hitResult.curve != null) {
|
||||||
|
float oldAlpha = Utils.COLOR_WHITE_FADE.a;
|
||||||
|
|
||||||
|
Curve curve = hitResult.curve;
|
||||||
|
Utils.COLOR_WHITE_FADE.a = alpha;
|
||||||
|
curve.color.a = alpha;
|
||||||
|
curve.draw();
|
||||||
|
|
||||||
|
Utils.COLOR_WHITE_FADE.a = oldAlpha;
|
||||||
|
}
|
||||||
|
|
||||||
|
Image scaledHitCircle = GameImage.HITCIRCLE.getImage().getScaledCopy(scale);
|
||||||
|
scaledHitCircle.setAlpha(alpha);
|
||||||
|
Image scaledHitCircleOverlay = GameImage.HITCIRCLE_OVERLAY.getImage().getScaledCopy(scale);
|
||||||
|
scaledHitCircleOverlay.setAlpha(alpha);
|
||||||
|
|
||||||
|
scaledHitCircle.drawCentered(hitResult.x, hitResult.y, hitResult.color);
|
||||||
|
scaledHitCircleOverlay.drawCentered(hitResult.x, hitResult.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
// hit result
|
||||||
|
if (hitResult.hitResultType == HitResultType.CIRCLE
|
||||||
|
|| hitResult.hitResultType == HitResultType.SLIDEREND
|
||||||
|
|| hitResult.hitResultType == HitResultType.SPINNER) {
|
||||||
|
float scale = Utils.easeBounce(
|
||||||
|
Utils.clamp(trackPosition - hitResult.time, 0, HITCIRCLE_TEXT_BOUNCE_TIME),
|
||||||
|
1f,
|
||||||
|
HITCIRCLE_TEXT_ANIM_SCALE - 1f,
|
||||||
|
HITCIRCLE_TEXT_BOUNCE_TIME
|
||||||
|
);
|
||||||
|
|
||||||
|
float alpha = Utils.easeOut(
|
||||||
|
Utils.clamp((trackPosition - hitResult.time) - HITCIRCLE_FADE_TIME, 0, HITCIRCLE_TEXT_FADE_TIME),
|
||||||
|
1f,
|
||||||
|
-1f,
|
||||||
|
HITCIRCLE_TEXT_FADE_TIME
|
||||||
|
);
|
||||||
|
|
||||||
|
Image scaledHitResult = hitResults[hitResult.result].getScaledCopy(scale);
|
||||||
|
scaledHitResult.setAlpha(alpha);
|
||||||
|
scaledHitResult.drawCentered(hitResult.x, hitResult.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
hitResult.alpha = 1 - ((float) (trackPosition - hitResult.time) / HITRESULT_FADE_TIME);
|
hitResult.alpha = 1 - ((float) (trackPosition - hitResult.time) / HITRESULT_FADE_TIME);
|
||||||
|
@ -1115,7 +1207,7 @@ public class GameData {
|
||||||
if (!Options.isPerfectHitBurstEnabled())
|
if (!Options.isPerfectHitBurstEnabled())
|
||||||
; // hide perfect hit results
|
; // hide perfect hit results
|
||||||
else
|
else
|
||||||
hitResultList.add(new OsuHitObjectResult(time, result, x, y, null, false));
|
hitResultList.add(new OsuHitObjectResult(time, result, x, y, null, HitResultType.SLIDERTICK));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1129,14 +1221,14 @@ public class GameData {
|
||||||
* @param end true if this is the last hit object in the combo
|
* @param end true if this is the last hit object in the combo
|
||||||
* @param hitObject the hit object
|
* @param hitObject the hit object
|
||||||
* @param repeat the current repeat number (for sliders, or 0 otherwise)
|
* @param repeat the current repeat number (for sliders, or 0 otherwise)
|
||||||
|
* @param hitResultType the type of hit object for the result
|
||||||
|
* @return the hit result (HIT_* constants)
|
||||||
*/
|
*/
|
||||||
public void hitResult(int time, int result, float x, float y, Color color,
|
private int hitRes(int time, int result, float x, float y, Color color,
|
||||||
boolean end, OsuHitObject hitObject, int repeat) {
|
boolean end, OsuHitObject hitObject, int repeat, HitResultType hitResultType) {
|
||||||
int hitValue = 0;
|
int hitValue = 0;
|
||||||
boolean perfectHit = false;
|
|
||||||
switch (result) {
|
switch (result) {
|
||||||
case HIT_300:
|
case HIT_300:
|
||||||
perfectHit = true;
|
|
||||||
hitValue = 300;
|
hitValue = 300;
|
||||||
changeHealth(5f);
|
changeHealth(5f);
|
||||||
break;
|
break;
|
||||||
|
@ -1156,7 +1248,7 @@ public class GameData {
|
||||||
resetComboStreak();
|
resetComboStreak();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return;
|
return HIT_MISS;
|
||||||
}
|
}
|
||||||
if (hitValue > 0) {
|
if (hitValue > 0) {
|
||||||
SoundController.playHitSound(
|
SoundController.playHitSound(
|
||||||
|
@ -1197,12 +1289,58 @@ public class GameData {
|
||||||
comboEnd = 0;
|
comboEnd = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (perfectHit && !Options.isPerfectHitBurstEnabled())
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handles a hit result.
|
||||||
|
* @param time the object start time
|
||||||
|
* @param result the hit result (HIT_* constants)
|
||||||
|
* @param x the x coordinate
|
||||||
|
* @param y the y coordinate
|
||||||
|
* @param color the combo color
|
||||||
|
* @param end true if this is the last hit object in the combo
|
||||||
|
* @param hitObject the hit object
|
||||||
|
* @param repeat the current repeat number (for sliders, or 0 otherwise)
|
||||||
|
* @param hitResultType the type of hit object for the result
|
||||||
|
*/
|
||||||
|
public void hitResult(int time, int result, float x, float y, Color color,
|
||||||
|
boolean end, OsuHitObject hitObject, int repeat, HitResultType hitResultType) {
|
||||||
|
result = hitRes(time, result, x, y, color, end, hitObject, repeat, hitResultType);
|
||||||
|
|
||||||
|
if ((result == HIT_300 || result == HIT_300G || result == HIT_300K)
|
||||||
|
&& !Options.isPerfectHitBurstEnabled())
|
||||||
; // hide perfect hit results
|
; // hide perfect hit results
|
||||||
else if (result == HIT_MISS && (GameMod.RELAX.isActive() || GameMod.AUTOPILOT.isActive()))
|
else if (result == HIT_MISS && (GameMod.RELAX.isActive() || GameMod.AUTOPILOT.isActive()))
|
||||||
; // "relax" and "autopilot" mods: hide misses
|
; // "relax" and "autopilot" mods: hide misses
|
||||||
else
|
else
|
||||||
hitResultList.add(new OsuHitObjectResult(time, result, x, y, color, hitObject.isSpinner()));
|
hitResultList.add(new OsuHitObjectResult(time, result, x, y, color, hitResultType));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handles a slider hit result.
|
||||||
|
* @param time the object start time
|
||||||
|
* @param result the hit result (HIT_* constants)
|
||||||
|
* @param x the x coordinate
|
||||||
|
* @param y the y coordinate
|
||||||
|
* @param color the combo color
|
||||||
|
* @param end true if this is the last hit object in the combo
|
||||||
|
* @param hitObject the hit object
|
||||||
|
* @param repeat the current repeat number (for sliders, or 0 otherwise)
|
||||||
|
* @param hitResultType the type of hit object for the result
|
||||||
|
* @param curve the slider curve
|
||||||
|
*/
|
||||||
|
public void hitResult(int time, int result, float x, float y, Color color,
|
||||||
|
boolean end, OsuHitObject hitObject, int repeat, HitResultType hitResultType, Curve curve) {
|
||||||
|
result = hitRes(time, result, x, y, color, end, hitObject, repeat, hitResultType);
|
||||||
|
|
||||||
|
if ((result == HIT_300 || result == HIT_300G || result == HIT_300K)
|
||||||
|
&& !Options.isPerfectHitBurstEnabled())
|
||||||
|
; // hide perfect hit results
|
||||||
|
else if (result == HIT_MISS && (GameMod.RELAX.isActive() || GameMod.AUTOPILOT.isActive()))
|
||||||
|
; // "relax" and "autopilot" mods: hide misses
|
||||||
|
else
|
||||||
|
hitResultList.add(new OsuHitObjectResult(time, result, x, y, color, hitResultType, curve));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -202,7 +202,6 @@ public enum GameImage {
|
||||||
SCORE_PERCENT ("score-percent", "png"),
|
SCORE_PERCENT ("score-percent", "png"),
|
||||||
SCORE_X ("score-x", "png"),
|
SCORE_X ("score-x", "png"),
|
||||||
LIGHTING ("lighting", "png"),
|
LIGHTING ("lighting", "png"),
|
||||||
LIGHTING1 ("lighting1", "png"),
|
|
||||||
|
|
||||||
// Game Mods
|
// Game Mods
|
||||||
MOD_EASY ("selection-mod-easy", "png", false, false),
|
MOD_EASY ("selection-mod-easy", "png", false, false),
|
||||||
|
|
|
@ -607,4 +607,30 @@ public class Utils {
|
||||||
else
|
else
|
||||||
return String.format("%02d:%02d:%02d", seconds / 3600, (seconds / 60) % 60, seconds % 60);
|
return String.format("%02d:%02d:%02d", seconds / 3600, (seconds / 60) % 60, seconds % 60);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Cubic ease out function
|
||||||
|
* @param t the current time
|
||||||
|
* @param a the starting position
|
||||||
|
* @param b the finishing position
|
||||||
|
* @param d the duration
|
||||||
|
* @return the eased float
|
||||||
|
*/
|
||||||
|
public static float easeOut(float t, float a, float b, float d) {
|
||||||
|
return b * ((t = t / d - 1f) * t * t + 1f) + a;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fake bounce ease function
|
||||||
|
* @param t the current time
|
||||||
|
* @param a the starting position
|
||||||
|
* @param b the finishing position
|
||||||
|
* @param d the duration
|
||||||
|
* @return the eased float
|
||||||
|
*/
|
||||||
|
public static float easeBounce(float t, float a, float b, float d) {
|
||||||
|
if (t < d / 2)
|
||||||
|
return easeOut(t, a, b, d);
|
||||||
|
return easeOut(d-t, a, b, d);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -138,7 +138,7 @@ public class Circle implements HitObject {
|
||||||
|
|
||||||
if (result > -1) {
|
if (result > -1) {
|
||||||
data.addHitError(hitObject.getTime(), x, y, timeDiff);
|
data.addHitError(hitObject.getTime(), x, y, timeDiff);
|
||||||
data.hitResult(hitObject.getTime(), result, this.x, this.y, color, comboEnd, hitObject, 0);
|
data.hitResult(hitObject.getTime(), result, this.x, this.y, color, comboEnd, hitObject, 0, HitResultType.CIRCLE);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -154,17 +154,17 @@ public class Circle implements HitObject {
|
||||||
|
|
||||||
if (overlap || trackPosition > time + hitResultOffset[GameData.HIT_50]) {
|
if (overlap || trackPosition > time + hitResultOffset[GameData.HIT_50]) {
|
||||||
if (isAutoMod) // "auto" mod: catch any missed notes due to lag
|
if (isAutoMod) // "auto" mod: catch any missed notes due to lag
|
||||||
data.hitResult(time, GameData.HIT_300, x, y, color, comboEnd, hitObject, 0);
|
data.hitResult(time, GameData.HIT_300, x, y, color, comboEnd, hitObject, 0, HitResultType.CIRCLE);
|
||||||
|
|
||||||
else // no more points can be scored, so send a miss
|
else // no more points can be scored, so send a miss
|
||||||
data.hitResult(time, GameData.HIT_MISS, x, y, null, comboEnd, hitObject, 0);
|
data.hitResult(time, GameData.HIT_MISS, x, y, null, comboEnd, hitObject, 0, HitResultType.CIRCLE);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// "auto" mod: send a perfect hit result
|
// "auto" mod: send a perfect hit result
|
||||||
else if (isAutoMod) {
|
else if (isAutoMod) {
|
||||||
if (Math.abs(trackPosition - time) < hitResultOffset[GameData.HIT_300]) {
|
if (Math.abs(trackPosition - time) < hitResultOffset[GameData.HIT_300]) {
|
||||||
data.hitResult(time, GameData.HIT_300, x, y, color, comboEnd, hitObject, 0);
|
data.hitResult(time, GameData.HIT_300, x, y, color, comboEnd, hitObject, 0, HitResultType.CIRCLE);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
10
src/itdelatrisu/opsu/objects/HitResultType.java
Normal file
10
src/itdelatrisu/opsu/objects/HitResultType.java
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
package itdelatrisu.opsu.objects;
|
||||||
|
|
||||||
|
public enum HitResultType {
|
||||||
|
CIRCLE,
|
||||||
|
//SLIDERSTART,
|
||||||
|
SLIDERTICK,
|
||||||
|
SLIDEREND,
|
||||||
|
SLIDEREND_FIRSTOBJECT,
|
||||||
|
SPINNER
|
||||||
|
}
|
|
@ -278,14 +278,13 @@ public class Slider implements HitObject {
|
||||||
else
|
else
|
||||||
result = GameData.HIT_MISS;
|
result = GameData.HIT_MISS;
|
||||||
|
|
||||||
if (currentRepeats % 2 == 0) { // last circle
|
|
||||||
float[] lastPos = curve.pointAt(1);
|
float[] lastPos = curve.pointAt(1);
|
||||||
data.hitResult(hitObject.getTime() + (int) sliderTimeTotal, result,
|
data.hitResult(hitObject.getTime() + (int) sliderTimeTotal, result,
|
||||||
lastPos[0], lastPos[1], color, comboEnd, hitObject, currentRepeats + 1);
|
x, y, color, comboEnd, hitObject, currentRepeats + 1,
|
||||||
} else { // first circle
|
currentRepeats % 2 == 0 ? HitResultType.SLIDEREND_FIRSTOBJECT : HitResultType.SLIDEREND, curve);
|
||||||
data.hitResult(hitObject.getTime() + (int) sliderTimeTotal, result,
|
data.hitResult(hitObject.getTime() + (int) sliderTimeTotal, result,
|
||||||
x, y, color, comboEnd, hitObject, currentRepeats + 1);
|
lastPos[0], lastPos[1], color, comboEnd, hitObject, currentRepeats + 1,
|
||||||
}
|
currentRepeats % 2 == 0 ? HitResultType.SLIDEREND : HitResultType.SLIDEREND_FIRSTOBJECT);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -191,7 +191,7 @@ public class Spinner implements HitObject {
|
||||||
result = GameData.HIT_MISS;
|
result = GameData.HIT_MISS;
|
||||||
|
|
||||||
data.hitResult(hitObject.getEndTime(), result, width / 2, height / 2,
|
data.hitResult(hitObject.getEndTime(), result, width / 2, height / 2,
|
||||||
Color.transparent, true, hitObject, 0);
|
Color.transparent, true, hitObject, 0, HitResultType.SPINNER);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,12 +28,12 @@ import org.newdawn.slick.Color;
|
||||||
* @author fluddokt (https://github.com/fluddokt)
|
* @author fluddokt (https://github.com/fluddokt)
|
||||||
*/
|
*/
|
||||||
public abstract class Curve {
|
public abstract class Curve {
|
||||||
|
/** The color of this curve. */
|
||||||
|
public Color color;
|
||||||
|
|
||||||
/** The associated OsuHitObject. */
|
/** The associated OsuHitObject. */
|
||||||
protected OsuHitObject hitObject;
|
protected OsuHitObject hitObject;
|
||||||
|
|
||||||
/** The color of this curve. */
|
|
||||||
protected Color color;
|
|
||||||
|
|
||||||
/** The scaled starting x, y coordinates. */
|
/** The scaled starting x, y coordinates. */
|
||||||
protected float x, y;
|
protected float x, y;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user