render mirrored

This commit is contained in:
yugecin
2016-09-29 21:40:42 +02:00
parent 72aa856818
commit 9a73ab23e9
6 changed files with 61 additions and 15 deletions

View File

@@ -89,7 +89,7 @@ public class Circle extends GameObject {
}
@Override
public void draw(Graphics g, int trackPosition) {
public void draw(Graphics g, int trackPosition, boolean mirror) {
int timeDiff = hitObject.getTime() - trackPosition;
final int approachTime = game.getApproachTime();
final int fadeInTime = game.getFadeInTime();
@@ -98,6 +98,11 @@ public class Circle extends GameObject {
float fadeinScale = (timeDiff - approachTime + fadeInTime) / (float) fadeInTime;
float alpha = Utils.clamp(1 - fadeinScale, 0, 1);
g.pushTransform();
if (mirror) {
g.rotate(x, y, -180f);
}
if (GameMod.HIDDEN.isActive()) {
final int hiddenDecayTime = game.getHiddenDecayTime();
final int hiddenTimeDiff = game.getHiddenTimeDiff();
@@ -122,6 +127,8 @@ public class Circle extends GameObject {
GameImage.HITCIRCLE_OVERLAY.getImage().drawCentered(x, y, Colors.WHITE_FADE);
Colors.WHITE_FADE.a = oldAlpha;
g.popTransform();
}
/**