ExGon mover

This commit is contained in:
yugecin 2017-01-01 23:47:11 +01:00
parent bf4bda949c
commit 3b49792554
6 changed files with 110 additions and 0 deletions

View File

@ -59,6 +59,7 @@ import com.sun.jna.platform.win32.Advapi32Util;
import com.sun.jna.platform.win32.Win32Exception;
import com.sun.jna.platform.win32.WinReg;
import yugecin.opsudance.*;
import yugecin.opsudance.movers.factories.ExgonMoverFactory;
import yugecin.opsudance.movers.factories.QuadraticBezierMoverFactory;
import yugecin.opsudance.movers.slidermovers.DefaultSliderMoverController;
@ -682,6 +683,16 @@ public class Options {
Dancer.instance.setMoverFactoryIndex(i);
}
},
DANCE_EXGON_DELAY ("ExGon delay", "ExGonDelay", "Delay between moves for the ExGon mover", 25, 2, 750) {
@Override
public String getValueString() {
return String.valueOf(val);
}
@Override
public boolean showCondition() {
return Dancer.moverFactories[Dancer.instance.getMoverFactoryIndex()] instanceof ExgonMoverFactory;
}
},
DANCE_QUAD_BEZ_AGGRESSIVENESS ("Quadratic Bezier aggressiveness", "QuadBezAgr", "AKA initial D factor", 50, 0, 200) {
@Override
public String getValueString() {
@ -1371,6 +1382,9 @@ public class Options {
}
}
public static int getExgonDelay() {
return GameOption.DANCE_EXGON_DELAY.getIntegerValue();
}
public static int getQuadBezAggressiveness() {
return GameOption.DANCE_QUAD_BEZ_AGGRESSIVENESS.getIntegerValue();
}

View File

@ -112,6 +112,7 @@ public class OptionsMenu extends BasicGameState implements OptionsOverlay.Parent
}),
new OptionTab("Dance", new GameOption[] {
GameOption.DANCE_MOVER,
GameOption.DANCE_EXGON_DELAY,
GameOption.DANCE_QUAD_BEZ_AGGRESSIVENESS,
GameOption.DANCE_QUAD_BEZ_SLIDER_AGGRESSIVENESS_FACTOR,
GameOption.DANCE_QUAD_BEZ_USE_CUBIC_ON_SLIDERS,

View File

@ -58,6 +58,7 @@ public class Dancer {
//new LinearFactory(),
new ArcFactory(),
new QuadraticBezierMoverFactory(),
new ExgonMoverFactory(),
};
public static Spinner[] spinners = new Spinner[] {

View File

@ -0,0 +1,57 @@
/*
* opsu!dance - fork of opsu! with cursordance auto
* Copyright (C) 2016 yugecin
*
* opsu!dance is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* opsu!dance is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with opsu!dance. If not, see <http://www.gnu.org/licenses/>.
*/
package yugecin.opsudance.movers;
import itdelatrisu.opsu.Options;
import itdelatrisu.opsu.objects.GameObject;
import java.util.Random;
public class ExgonMover extends Mover {
private double[] pos;
private int nextTime;
private static final Random randgen = new Random();
public ExgonMover(GameObject start, GameObject end, int dir) {
super(start, end, dir);
nextTime = start.getEndTime() + Options.getExgonDelay();
pos = new double[] { start.end.x, start.end.y };
}
@Override
public double[] getPointAt(int time) {
if (time > nextTime) {
nextTime = time + Options.getExgonDelay();
if (time > getEnd().getEndTime() - Options.getExgonDelay()) {
pos[0] = endX;
pos[1] = endY;
} else {
pos[0] = randgen.nextInt(Options.width);
pos[1] = randgen.nextInt(Options.height);
}
}
return pos;
}
@Override
public String getName() {
return "ExGon";
}
}

View File

@ -0,0 +1,36 @@
/*
* opsu!dance - fork of opsu! with cursordance auto
* Copyright (C) 2016 yugecin
*
* opsu!dance is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* opsu!dance is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with opsu!dance. If not, see <http://www.gnu.org/licenses/>.
*/
package yugecin.opsudance.movers.factories;
import itdelatrisu.opsu.objects.GameObject;
import yugecin.opsudance.movers.ExgonMover;
import yugecin.opsudance.movers.Mover;
public class ExgonMoverFactory extends AutoMoverFactory {
@Override
protected Mover donext(GameObject start, GameObject end, int dir, int dt, double velocity) {
return new ExgonMover(start, end, dir);
}
@Override
public String toString() {
return "ExGon";
}
}

View File

@ -55,6 +55,7 @@ public class SBOverlay implements OptionsOverlay.Parent {
}),
new OptionTab("Dance", new GameOption[] {
GameOption.DANCE_MOVER,
GameOption.DANCE_EXGON_DELAY,
GameOption.DANCE_QUAD_BEZ_AGGRESSIVENESS,
GameOption.DANCE_QUAD_BEZ_SLIDER_AGGRESSIVENESS_FACTOR,
GameOption.DANCE_QUAD_BEZ_USE_CUBIC_ON_SLIDERS,