fix first object movement

This commit is contained in:
yugecin 2016-10-01 11:34:32 +02:00
parent 98c00679ad
commit eee65a589e
3 changed files with 20 additions and 5 deletions

View File

@ -43,6 +43,12 @@ public class DummyObject extends GameObject {
updatePosition();
}
public DummyObject() {
this.hitObject = new HitObject("0,0,0,1,0,0:0:0:0:");
updatePosition();
updateStartEndPositions(0);
}
@Override
public void draw(Graphics g, int trackPosition, boolean mirror) {}

View File

@ -348,11 +348,15 @@ public class Game extends BasicGameState {
autoMousePressed = false;
if (GameMod.AUTO.isActive() || GameMod.AUTOPILOT.isActive()) {
Vec2f autoPoint;
if (objectIndex == 0) {
autoPoint = gameObjects[0].getPointAt(trackPosition);
} else if (objectIndex < beatmap.objects.length) {
if (objectIndex < beatmap.objects.length) {
GameObject p;
if (objectIndex > 0) {
p = gameObjects[objectIndex - 1];
} else {
p = null;
}
Dancer d = Dancer.instance;
d.update(trackPosition, gameObjects[objectIndex - 1], gameObjects[objectIndex]);
d.update(trackPosition, p, gameObjects[objectIndex]);
autoPoint = new Vec2f(d.x, d.y);
if (trackPosition < gameObjects[objectIndex].getTime()) {
autoMousePressed = true;

View File

@ -20,6 +20,7 @@ package yugecin.opsudance;
import itdelatrisu.opsu.Options;
import itdelatrisu.opsu.Utils;
import itdelatrisu.opsu.objects.Circle;
import itdelatrisu.opsu.objects.DummyObject;
import itdelatrisu.opsu.objects.GameObject;
import itdelatrisu.opsu.objects.Slider;
import itdelatrisu.opsu.objects.curves.Vec2f;
@ -67,6 +68,7 @@ public class Dancer {
public static boolean hideobjects = false;
private int dir;
private GameObject d = new DummyObject();
private GameObject p;
private MoverFactory moverFactory;
@ -90,7 +92,7 @@ public class Dancer {
public void reset() {
isCurrentLazySlider = false;
p = null;
p = d;
dir = 1;
for (Spinner s : spinners) {
s.init();
@ -124,6 +126,9 @@ 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;
}
isCurrentLazySlider = false;
// detect lazy sliders, should work pretty good
if (c.isSlider() && LAZY_SLIDERS && Utils.distance(c.start.x, c.start.y, c.end.x , c.end.y) <= Circle.diameter * 0.8f) {