fix start

This commit is contained in:
yugecin 2016-10-01 15:47:01 +02:00
parent eb834134ee
commit 6ad4348d7c
2 changed files with 9 additions and 5 deletions

View File

@ -353,7 +353,7 @@ public class Game extends BasicGameState {
if (objectIndex > 0) { if (objectIndex > 0) {
p = gameObjects[objectIndex - 1]; p = gameObjects[objectIndex - 1];
} else { } else {
p = null; p = Dancer.d;
} }
Dancer d = Dancer.instance; Dancer d = Dancer.instance;
d.update(trackPosition, p, gameObjects[objectIndex]); d.update(trackPosition, p, gameObjects[objectIndex]);

View File

@ -24,6 +24,7 @@ import itdelatrisu.opsu.objects.DummyObject;
import itdelatrisu.opsu.objects.GameObject; import itdelatrisu.opsu.objects.GameObject;
import itdelatrisu.opsu.objects.Slider; import itdelatrisu.opsu.objects.Slider;
import itdelatrisu.opsu.objects.curves.Vec2f; import itdelatrisu.opsu.objects.curves.Vec2f;
import yugecin.opsudance.movers.LinearMover;
import yugecin.opsudance.movers.Mover; import yugecin.opsudance.movers.Mover;
import yugecin.opsudance.movers.factories.*; import yugecin.opsudance.movers.factories.*;
import yugecin.opsudance.spinners.*; import yugecin.opsudance.spinners.*;
@ -71,7 +72,7 @@ public class Dancer {
public static int cursortraillength = 20; public static int cursortraillength = 20;
private int dir; private int dir;
private GameObject d = new DummyObject(); public static final GameObject d = new DummyObject();
private GameObject p; private GameObject p;
private MoverFactory moverFactory; private MoverFactory moverFactory;
@ -95,7 +96,7 @@ public class Dancer {
public void reset() { public void reset() {
isCurrentLazySlider = false; isCurrentLazySlider = false;
p = d; p = null;
dir = 1; dir = 1;
for (Spinner s : spinners) { for (Spinner s : spinners) {
s.init(); s.init();
@ -129,8 +130,11 @@ public class Dancer {
public void update(int time, GameObject p, GameObject c) { public void update(int time, GameObject p, GameObject c) {
if (this.p != p) { if (this.p != p) {
this.p = p; this.p = p;
if (this.p == null) { if (this.p == d) {
this.p = p = d; if (c.isSpinner()) {
double[] spinnerStartPoint = spinner.getPoint();
c.start.set((float) spinnerStartPoint[0], (float) spinnerStartPoint[1]);
}
} }
isCurrentLazySlider = false; isCurrentLazySlider = false;
// detect lazy sliders, should work pretty good // detect lazy sliders, should work pretty good