Follow-up to #71.

- Fixed a major bug where two hit result calculations were being performed for each slider.
- Fixed a bug where hit circles/sliders were being drawn for a miss.
- Sliders now only expand when held to the end (as in osu!).
- Use the track position as the hit result start time for circles (instead of the object time).
- Added a 'color' parameter to Curve.draw(), rather than keeping an extra reference to the slider Color object.
- Renamed HitResultType enum to HitObjectType, and moved it into GameData.
- Removed some overloaded methods (not really necessary...).
- Other style changes.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han
2015-04-08 02:05:12 -04:00
parent dda9081149
commit 4eaf0b6a54
9 changed files with 88 additions and 128 deletions

View File

@@ -179,7 +179,7 @@ public class CircumscribedCircle extends Curve {
}
@Override
public void draw() {
public void draw(Color color) {
Image hitCircle = GameImage.HITCIRCLE.getImage();
Image hitCircleOverlay = GameImage.HITCIRCLE_OVERLAY.getImage();
for (int i = 0; i < step; i++)

View File

@@ -28,9 +28,6 @@ import org.newdawn.slick.Color;
* @author fluddokt (https://github.com/fluddokt)
*/
public abstract class Curve {
/** The color of this curve. */
public Color color;
/** The associated OsuHitObject. */
protected OsuHitObject hitObject;
@@ -51,7 +48,6 @@ public abstract class Curve {
this.y = hitObject.getScaledY();
this.sliderX = hitObject.getScaledSliderX();
this.sliderY = hitObject.getScaledSliderY();
this.color = color;
}
/**
@@ -63,8 +59,9 @@ public abstract class Curve {
/**
* Draws the full curve to the graphics context.
* @param color the color filter
*/
public abstract void draw();
public abstract void draw(Color color);
/**
* Returns the angle of the first control point.

View File

@@ -164,7 +164,7 @@ public class LinearBezier extends Curve {
}
@Override
public void draw() {
public void draw(Color color) {
Image hitCircle = GameImage.HITCIRCLE.getImage();
Image hitCircleOverlay = GameImage.HITCIRCLE_OVERLAY.getImage();
for (int i = curve.length - 2; i >= 0; i--)