From 6965e33856195a31551451fdafde84d45626a9f9 Mon Sep 17 00:00:00 2001 From: yugecin Date: Fri, 30 Sep 2016 10:04:47 +0200 Subject: [PATCH] fix halfellipsemover so it doesnt get stuck --- src/yugecin/opsudance/movers/HalfEllipseMover.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/yugecin/opsudance/movers/HalfEllipseMover.java b/src/yugecin/opsudance/movers/HalfEllipseMover.java index 0530208d..a5132430 100644 --- a/src/yugecin/opsudance/movers/HalfEllipseMover.java +++ b/src/yugecin/opsudance/movers/HalfEllipseMover.java @@ -30,8 +30,8 @@ public class HalfEllipseMover extends Mover { public HalfEllipseMover(GameObject start, GameObject end, int dir) { super(start, end, dir); - middlex = (startX - endX) / 2d; - middley = (startY - endY) / 2d; + middlex = (startX + endX) / 2d; + middley = (startY + endY) / 2d; radius = Utils.distance(middlex, middley, startX, startY); ang = Math.atan2(startY - middley, startX - middlex); mod = 2d; @@ -44,8 +44,8 @@ public class HalfEllipseMover extends Mover { @Override public double[] getPointAt(int time) { double Tangle = Math.PI * getT(time) * dir; - double x = middlex + Math.cos(Tangle) * radius; - double y = middley + Math.sin(Tangle) * radius; + double x = middlex + Math.cos(Tangle) * radius * mod; // TODO fix this + double y = middley + Math.sin(Tangle) * radius * mod; double dx = middlex - x; double dy = middley - y;