summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/ch/asynk/tankontank')
-rw-r--r--core/src/ch/asynk/tankontank/game/states/GameStateCommon.java5
-rw-r--r--core/src/ch/asynk/tankontank/game/states/GameStateDirection.java2
-rw-r--r--core/src/ch/asynk/tankontank/game/states/GameStateMove.java3
-rw-r--r--core/src/ch/asynk/tankontank/game/states/GameStateRotate.java2
4 files changed, 10 insertions, 2 deletions
diff --git a/core/src/ch/asynk/tankontank/game/states/GameStateCommon.java b/core/src/ch/asynk/tankontank/game/states/GameStateCommon.java
index 249288e..5ef6c0b 100644
--- a/core/src/ch/asynk/tankontank/game/states/GameStateCommon.java
+++ b/core/src/ch/asynk/tankontank/game/states/GameStateCommon.java
@@ -72,6 +72,11 @@ public abstract class GameStateCommon implements GameState
protected void selectHex()
{
+ selectHex(hex);
+ }
+
+ protected void selectHex(GridPoint2 hex)
+ {
map.enableOverlayOn(hex, Hex.BLUE, true);
}
diff --git a/core/src/ch/asynk/tankontank/game/states/GameStateDirection.java b/core/src/ch/asynk/tankontank/game/states/GameStateDirection.java
index 4615075..581a987 100644
--- a/core/src/ch/asynk/tankontank/game/states/GameStateDirection.java
+++ b/core/src/ch/asynk/tankontank/game/states/GameStateDirection.java
@@ -24,7 +24,7 @@ public class GameStateDirection extends GameStateCommon
clear();
unselectHex();
hex.set(tmp.x, tmp.y);
- selectHex();
+ unselectHex();
ctrl.setState(State.ANIMATION);
}
}
diff --git a/core/src/ch/asynk/tankontank/game/states/GameStateMove.java b/core/src/ch/asynk/tankontank/game/states/GameStateMove.java
index 0cb880e..bc6e535 100644
--- a/core/src/ch/asynk/tankontank/game/states/GameStateMove.java
+++ b/core/src/ch/asynk/tankontank/game/states/GameStateMove.java
@@ -14,6 +14,7 @@ public class GameStateMove extends GameStateCommon
map.enablePossibleTargets(false);
map.enablePossiblePaths(false, false);
if (hasPawn()) {
+ selectHex();
skipFirst = false;
map.clearPossiblePaths();
map.buildAndShowPossibleMoves(pawn, hex);
@@ -77,7 +78,7 @@ public class GameStateMove extends GameStateCommon
to.set(upHex.x, upHex.y);
map.clearPossiblePaths();
int s = map.buildPossiblePaths(pawn, from, to);
- map.togglePathOverlay(downHex);
+ selectHex(downHex);
map.enablePossibleMoves(false);
map.enablePossiblePaths(true, true);
return s;
diff --git a/core/src/ch/asynk/tankontank/game/states/GameStateRotate.java b/core/src/ch/asynk/tankontank/game/states/GameStateRotate.java
index 4d36e22..d4bf2ae 100644
--- a/core/src/ch/asynk/tankontank/game/states/GameStateRotate.java
+++ b/core/src/ch/asynk/tankontank/game/states/GameStateRotate.java
@@ -9,6 +9,7 @@ public class GameStateRotate extends GameStateCommon
{
map.hidePossibles();
if (hasPawn()) {
+ selectHex();
map.enableDirections(hex, true);
}
}
@@ -35,6 +36,7 @@ public class GameStateRotate extends GameStateCommon
Orientation o = Orientation.fromAdj(hex.x, hex.y, downHex.x, downHex.y);
if (o != Orientation.KEEP) {
+ unselectHex();
map.enableDirections(hex, false);
if (pawn.getOrientation() != o) {
map.rotatePawn(pawn, o);