Fixed issue where slider end distance calculations ignored repeats.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han 2014-07-18 21:13:17 -04:00
parent 64788b2832
commit c0870afb77

View File

@ -539,7 +539,8 @@ public class Slider {
// check if cursor pressed and within end circle // check if cursor pressed and within end circle
else if (Utils.isGameKeyPressed()) { else if (Utils.isGameKeyPressed()) {
double distance = Math.hypot(hitObject.getSliderX()[lastIndex] - mouseX, hitObject.getSliderY()[lastIndex] - mouseY); float[] c = bezier.pointAt(getT(trackPosition, false));
double distance = Math.hypot(c[0] - mouseX, c[1] - mouseY);
int followCircleRadius = GameImage.SLIDER_FOLLOWCIRCLE.getImage().getWidth() / 2; int followCircleRadius = GameImage.SLIDER_FOLLOWCIRCLE.getImage().getWidth() / 2;
if (distance < followCircleRadius) if (distance < followCircleRadius)
ticksHit++; ticksHit++;
@ -604,7 +605,7 @@ public class Slider {
followCircleActive = false; followCircleActive = false;
if (isNewRepeat) if (isNewRepeat)
score.sliderTickResult(trackPosition, GameScore.HIT_MISS, 0, 0, hitSound); score.sliderTickResult(trackPosition, GameScore.HIT_MISS, 0, 0, (byte) -1);
if (isNewTick) if (isNewTick)
score.sliderTickResult(trackPosition, GameScore.HIT_MISS, 0, 0, (byte) -1); score.sliderTickResult(trackPosition, GameScore.HIT_MISS, 0, 0, (byte) -1);
} }