summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-09-30 19:21:26 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2014-09-30 19:21:26 +0200
commit0b3f7e947212d7efc7690870b2ea06295c9b4ecd (patch)
tree2272de5b1bb9794929e31d6ed5aad2e6ce3db00c /core
parent49a39415a4f51799ec2272fde507981653c9b3c6 (diff)
downloadRustAndDust-0b3f7e947212d7efc7690870b2ea06295c9b4ecd.zip
RustAndDust-0b3f7e947212d7efc7690870b2ea06295c9b4ecd.tar.gz
Map: fix touchUp
Diffstat (limited to 'core')
-rw-r--r--core/src/ch/asynk/tankontank/game/Map.java20
1 files changed, 12 insertions, 8 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java
index a66962e..363033d 100644
--- a/core/src/ch/asynk/tankontank/game/Map.java
+++ b/core/src/ch/asynk/tankontank/game/Map.java
@@ -47,6 +47,7 @@ public abstract class Map extends Board
{
if (currentHex.x != -1)
enableOverlayOn(currentHex.x, currentHex.y, Hex.BLUE, false);
+
getHexAt(currentHex, x, y);
if (currentHex.x != -1) {
enableOverlayOn(currentHex.x, currentHex.y, Hex.BLUE, true);
@@ -63,15 +64,18 @@ public abstract class Map extends Board
{
if (currentHex.x != -1)
enableOverlayOn(currentHex.x, currentHex.y, Hex.BLUE, false);
+
getHexAt(currentHex, x, y);
- if (currentPawn != null) {
- enableOverlayOn(currentHex.x, currentHex.y, Hex.BLUE, true);
- pawnsToDraw.remove(currentPawn);
- if (currentHex.x != -1) {
- movePawnTo(currentPawn, currentHex);
- showPossibleActions(currentPawn);
- } else {
- resetPawnMoves(currentPawn);
+ if (currentHex.x == -1) {
+ resetPawnMoves(currentPawn);
+ } else {
+ if (currentPawn != null) {
+ enableOverlayOn(currentHex.x, currentHex.y, Hex.BLUE, true);
+ pawnsToDraw.remove(currentPawn);
+ if (currentHex.x != -1) {
+ movePawnTo(currentPawn, currentHex);
+ showPossibleActions(currentPawn);
+ }
}
}
}