add option for mirrorcollage

This commit is contained in:
yugecin 2016-09-29 23:29:20 +02:00
parent 0d89c2612d
commit 7f908db6e7
4 changed files with 30 additions and 9 deletions

View File

@ -638,6 +638,20 @@ public class Options {
} }
}, },
DANCE_MIRROR ("Mirror collage", "MirrorCollage", "Hypnotizing stuff", false) {
@Override
public void click(GameContainer container) {
bool = !bool;
Dancer.mirror = bool;
}
@Override
public void read(String s) {
super.read(s);
Dancer.mirror = bool;
}
},
PIPPI_ENABLE ("Pippi", "Pippi", "Move in circles like dancing pippi (osu! april fools joke 2016)", false) { PIPPI_ENABLE ("Pippi", "Pippi", "Move in circles like dancing pippi (osu! april fools joke 2016)", false) {
// TODO // TODO
}, },

View File

@ -601,11 +601,13 @@ public class Game extends BasicGameState {
UI.draw(g, replayX, replayY, replayKeyPressed); UI.draw(g, replayX, replayY, replayKeyPressed);
else if (GameMod.AUTO.isActive()) { else if (GameMod.AUTO.isActive()) {
UI.draw(g, (int) autoMousePosition.x, (int) autoMousePosition.y, autoMousePressed); UI.draw(g, (int) autoMousePosition.x, (int) autoMousePosition.y, autoMousePressed);
double dx = autoMousePosition.x - Options.width / 2d; if (Dancer.mirror) {
double dy = autoMousePosition.y - Options.height / 2d; double dx = autoMousePosition.x - Options.width / 2d;
double d = Math.sqrt(dx * dx + dy * dy); double dy = autoMousePosition.y - Options.height / 2d;
double a = Math.atan2(dy, dx) + Math.PI; double d = Math.sqrt(dx * dx + dy * dy);
mirrorCursor.draw((int) (Math.cos(a) * d + Options.width / 2), (int) (Math.sin(a) * d + Options.height / 2), autoMousePressed); double a = Math.atan2(dy, dx) + Math.PI;
mirrorCursor.draw((int) (Math.cos(a) * d + Options.width / 2), (int) (Math.sin(a) * d + Options.height / 2), autoMousePressed);
}
} }
else if (GameMod.AUTOPILOT.isActive()) else if (GameMod.AUTOPILOT.isActive())
UI.draw(g, (int) autoMousePosition.x, (int) autoMousePosition.y, Utils.isGameKeyPressed()); UI.draw(g, (int) autoMousePosition.x, (int) autoMousePosition.y, Utils.isGameKeyPressed());
@ -1397,10 +1399,12 @@ public class Game extends BasicGameState {
// normal case // normal case
if (!loseState) { if (!loseState) {
gameObj.draw(g, trackPosition, false); gameObj.draw(g, trackPosition, false);
g.pushTransform(); if (Dancer.mirror) {
g.rotate(Options.width / 2f, Options.height / 2f, 180f); g.pushTransform();
gameObj.draw(g, trackPosition, true); g.rotate(Options.width / 2f, Options.height / 2f, 180f);
g.popTransform(); gameObj.draw(g, trackPosition, true);
g.popTransform();
}
} }
// death: make objects "fall" off the screen // death: make objects "fall" off the screen
else { else {

View File

@ -110,6 +110,7 @@ public class OptionsMenu extends BasicGameState {
GameOption.DANCE_LAZY_SLIDERS, GameOption.DANCE_LAZY_SLIDERS,
GameOption.DANCE_CIRCLE_STREAMS, GameOption.DANCE_CIRCLE_STREAMS,
GameOption.DANCE_ONLY_CIRCLE_STACKS, GameOption.DANCE_ONLY_CIRCLE_STACKS,
GameOption.DANCE_MIRROR,
}), }),
PIPPI ("Pippi", new GameOption[] { PIPPI ("Pippi", new GameOption[] {
GameOption.PIPPI_ENABLE, GameOption.PIPPI_ENABLE,

View File

@ -50,6 +50,8 @@ public class Dancer {
public static Dancer instance = new Dancer(); public static Dancer instance = new Dancer();
public static boolean mirror; // this should really get its own place somewhere...
private int dir; private int dir;
private GameObject p; private GameObject p;
private Random rand; private Random rand;