summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-11-22 23:10:43 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-11-22 23:10:43 +0100
commit08d56f3b3f18d6c3863bda91f876daa6e62e415c (patch)
tree413001416cdd4a896c54b66e93fabf1a610c8714
parentf82e2eca20dc1daab67b944d486a7c8a3806643a (diff)
downloadRustAndDust-08d56f3b3f18d6c3863bda91f876daa6e62e415c.zip
RustAndDust-08d56f3b3f18d6c3863bda91f876daa6e62e415c.tar.gz
hud/Position: replace up() down() with horizontal/verticalMirror()
-rw-r--r--core/src/ch/asynk/tankontank/game/Hud.java2
-rw-r--r--core/src/ch/asynk/tankontank/game/hud/Position.java38
2 files changed, 23 insertions, 17 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Hud.java b/core/src/ch/asynk/tankontank/game/Hud.java
index 7c31aa0..49b8a34 100644
--- a/core/src/ch/asynk/tankontank/game/Hud.java
+++ b/core/src/ch/asynk/tankontank/game/Hud.java
@@ -76,7 +76,7 @@ public class Hud implements Disposable
{
Position position = ctrl.battle.getHudPosition(ctrl.player);
playerInfo.update(ctrl.player, position);
- actionButtons.setPosition(position.down());
+ actionButtons.setPosition(position.horizontalMirror());
}
public void animate(float delta)
diff --git a/core/src/ch/asynk/tankontank/game/hud/Position.java b/core/src/ch/asynk/tankontank/game/hud/Position.java
index 0556aba..4f490bd 100644
--- a/core/src/ch/asynk/tankontank/game/hud/Position.java
+++ b/core/src/ch/asynk/tankontank/game/hud/Position.java
@@ -15,45 +15,51 @@ public enum Position
BOTTOM_RIGHT,
BOTTOM_CENTER;
- public Position down()
+ public Position verticalMirror()
{
- Position p = BOTTOM_LEFT;
+ Position p = this;
switch(this) {
case TOP_LEFT:
+ p = TOP_RIGHT;
+ break;
case MIDDLE_LEFT:
- case BOTTOM_LEFT:
- p = BOTTOM_LEFT;
+ p = MIDDLE_RIGHT;
break;
- case TOP_CENTER:
- case MIDDLE_CENTER:
- case BOTTOM_CENTER:
- p = BOTTOM_CENTER;
+ case BOTTOM_LEFT:
+ p = BOTTOM_RIGHT;
break;
case TOP_RIGHT:
+ p = TOP_LEFT;
+ break;
case MIDDLE_RIGHT:
+ p = MIDDLE_LEFT;
+ break;
case BOTTOM_RIGHT:
- p = BOTTOM_RIGHT;
+ p = BOTTOM_LEFT;
break;
}
return p;
}
- public Position up()
+ public Position horizontalMirror()
{
- Position p = TOP_LEFT;
+ Position p = this;
switch(this) {
case TOP_LEFT:
- case MIDDLE_LEFT:
+ p = BOTTOM_LEFT;
+ break;
+ case TOP_CENTER:
+ p = BOTTOM_CENTER;
+ break;
+ case TOP_RIGHT:
+ p = BOTTOM_RIGHT;
+ break;
case BOTTOM_LEFT:
p = TOP_LEFT;
break;
- case TOP_CENTER:
- case MIDDLE_CENTER:
case BOTTOM_CENTER:
p = TOP_CENTER;
break;
- case TOP_RIGHT:
- case MIDDLE_RIGHT:
case BOTTOM_RIGHT:
p = TOP_RIGHT;
break;