From ad370fd8fb1b659b571576152bc6c85c3381ea70 Mon Sep 17 00:00:00 2001 From: yugecin Date: Fri, 30 Sep 2016 23:53:48 +0200 Subject: [PATCH] Show mirrored result for slider ends --- src/itdelatrisu/opsu/objects/Slider.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/itdelatrisu/opsu/objects/Slider.java b/src/itdelatrisu/opsu/objects/Slider.java index 8359106b..8112ca26 100644 --- a/src/itdelatrisu/opsu/objects/Slider.java +++ b/src/itdelatrisu/opsu/objects/Slider.java @@ -429,6 +429,17 @@ public class Slider extends GameObject { data.hitResult(hitObject.getTime() + (int) sliderTimeTotal, result, cx, cy, color, comboEnd, hitObject, type, sliderHeldToEnd, currentRepeats + 1, curve, sliderHeldToEnd); + if (Dancer.mirror) { + double dx = cx - Options.width / 2d; + double dy = cy - Options.height / 2d; + double ang = Math.atan2(dy, dx); + double d = -Math.sqrt(dx * dx + dy * dy); + float nx = (float) (Options.width / 2d + Math.cos(ang) * d); + float ny = (float) (Options.height / 2d + Math.sin(ang) * d); + data.hitResult(hitObject.getTime() + (int) sliderTimeTotal, result, + nx, ny, mirrorColor, comboEnd, hitObject, type, sliderHeldToEnd, + currentRepeats + 1, curve, sliderHeldToEnd); + } return result; }