From 6ad4348d7c33e4ec78ae294b50471a2fc7a73d80 Mon Sep 17 00:00:00 2001 From: yugecin Date: Sat, 1 Oct 2016 15:47:01 +0200 Subject: [PATCH] fix start --- src/itdelatrisu/opsu/states/Game.java | 2 +- src/yugecin/opsudance/Dancer.java | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/itdelatrisu/opsu/states/Game.java b/src/itdelatrisu/opsu/states/Game.java index 64e94c57..090c34a5 100644 --- a/src/itdelatrisu/opsu/states/Game.java +++ b/src/itdelatrisu/opsu/states/Game.java @@ -353,7 +353,7 @@ public class Game extends BasicGameState { if (objectIndex > 0) { p = gameObjects[objectIndex - 1]; } else { - p = null; + p = Dancer.d; } Dancer d = Dancer.instance; d.update(trackPosition, p, gameObjects[objectIndex]); diff --git a/src/yugecin/opsudance/Dancer.java b/src/yugecin/opsudance/Dancer.java index ccf51619..7ab7f960 100644 --- a/src/yugecin/opsudance/Dancer.java +++ b/src/yugecin/opsudance/Dancer.java @@ -24,6 +24,7 @@ import itdelatrisu.opsu.objects.DummyObject; import itdelatrisu.opsu.objects.GameObject; import itdelatrisu.opsu.objects.Slider; import itdelatrisu.opsu.objects.curves.Vec2f; +import yugecin.opsudance.movers.LinearMover; import yugecin.opsudance.movers.Mover; import yugecin.opsudance.movers.factories.*; import yugecin.opsudance.spinners.*; @@ -71,7 +72,7 @@ public class Dancer { public static int cursortraillength = 20; private int dir; - private GameObject d = new DummyObject(); + public static final GameObject d = new DummyObject(); private GameObject p; private MoverFactory moverFactory; @@ -95,7 +96,7 @@ public class Dancer { public void reset() { isCurrentLazySlider = false; - p = d; + p = null; dir = 1; for (Spinner s : spinners) { s.init(); @@ -129,8 +130,11 @@ public class Dancer { public void update(int time, GameObject p, GameObject c) { if (this.p != p) { this.p = p; - if (this.p == null) { - this.p = p = d; + if (this.p == d) { + if (c.isSpinner()) { + double[] spinnerStartPoint = spinner.getPoint(); + c.start.set((float) spinnerStartPoint[0], (float) spinnerStartPoint[1]); + } } isCurrentLazySlider = false; // detect lazy sliders, should work pretty good