Implement circleslowsliders

This commit is contained in:
yugecin 2016-10-01 14:46:39 +02:00
parent 54fa335492
commit 9d6c413eb7
4 changed files with 19 additions and 7 deletions

View File

@ -115,6 +115,8 @@ public class Slider extends GameObject {
public static double bpm;
public float pixelLength;
/**
* Initializes the Slider data type with images and dimensions.
* @param container the game container
@ -164,6 +166,8 @@ public class Slider extends GameObject {
mirrorColor = Dancer.colorMirrorOverride.getColor(comboColorIndex);
updatePosition();
this.pixelLength = hitObject.getPixelLength();
// slider time calculations
this.sliderTime = hitObject.getSliderTime(sliderMultiplier, game.getBeatLength());
this.sliderTimeTotal = sliderTime * hitObject.getRepeatCount();

View File

@ -113,6 +113,7 @@ public class OptionsMenu extends BasicGameState {
GameOption.DANCE_LAZY_SLIDERS,
GameOption.DANCE_CIRCLE_STREAMS,
GameOption.DANCE_ONLY_CIRCLE_STACKS,
GameOption.DANCE_CIRLCE_IN_SLOW_SLIDERS,
GameOption.DANCE_MIRROR,
}),
DANCEDISP ("Dance display", new GameOption[] {

View File

@ -134,7 +134,7 @@ public class Dancer {
}
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) {
if (c.isSlider() && LAZY_SLIDERS && Utils.distance(c.start.x, c.start.y, c.end.x, c.end.y) <= Circle.diameter * 0.8f) {
Slider s = (Slider) c;
Vec2f mid = s.getCurve().pointAt(1f);
if (s.getRepeats() == 1 || Utils.distance(c.start.x, c.start.y, mid.x, mid.y) <= Circle.diameter * 0.8f) {

View File

@ -19,6 +19,7 @@ package yugecin.opsudance;
import itdelatrisu.opsu.objects.Circle;
import itdelatrisu.opsu.objects.GameObject;
import itdelatrisu.opsu.objects.Slider;
public class Pippi {
@ -46,20 +47,23 @@ public class Pippi {
}
public static void dance(int time, GameObject c, boolean isCurrentLazySlider) {
if (!enabled || c.isSpinner()) {
boolean slowSlider = circleSlowSliders && c.isSlider() && (((((Slider) c).pixelLength < 200 || c.getEndTime() - c.getTime() > 400)) || isCurrentLazySlider);
if ((!enabled || c.isSpinner()) && !slowSlider) {
return;
}
if (currentdelta >= targetdelta && c != previous) {
currentdelta = 0;
if (c.isSlider() && c.getTime() < time) {
angle += angleSliderInc / 1800d * Math.PI;
if (followcircleExpand && !isCurrentLazySlider) {
if (!slowSlider) {
if (followcircleExpand) {
if (c.getEndTime() - time < 40 && pippirad > pippimaxrad) {
pippirad -= 5d;
} else if (time - c.getTime() > 10 && c.getEndTime() - c.getTime() > 600 && pippirad < pippimaxrad){
} else if (time - c.getTime() > 10 && c.getEndTime() - c.getTime() > 600 && pippirad < pippimaxrad) {
pippirad += 3d;
}
}
}
} else if (!c.isSpinner()) {
if (followcircleExpand && pippirad != pippiminrad) {
pippirad = pippiminrad;
@ -74,6 +78,9 @@ public class Pippi {
}
Dancer.instance.x += pippirad * Math.cos(angle);
Dancer.instance.y += pippirad * Math.sin(angle);
if (slowSlider) {
c.end.set(Dancer.instance.x,Dancer.instance.y);
}
}
public static void update(int delta) {