summaryrefslogtreecommitdiffstats
path: root/core/src/ch
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/ch')
-rw-r--r--core/src/ch/asynk/tankontank/game/Map.java12
-rw-r--r--core/src/ch/asynk/tankontank/screens/GameScreen.java4
2 files changed, 15 insertions, 1 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java
index 3418d56..b7ee78e 100644
--- a/core/src/ch/asynk/tankontank/game/Map.java
+++ b/core/src/ch/asynk/tankontank/game/Map.java
@@ -57,6 +57,18 @@ public abstract class Map extends Board
}
}
+ public void showMoves(float x, float y)
+ {
+ for(GridPoint2 hex : areaPoints)
+ enableOverlayOn(hex.x, hex.y, Hex.GREEN, false);
+
+ getHexAt(currentHex, x, y);
+ Pawn pawn = getTopPawnAt(currentHex);
+ if (pawn == null) return;
+ for(GridPoint2 hex : reachableFrom(pawn, currentHex.x, currentHex.y))
+ enableOverlayOn(hex.x, hex.y, Hex.GREEN, true);
+ }
+
private void debugMap()
{
int o = Hex.FOG;
diff --git a/core/src/ch/asynk/tankontank/screens/GameScreen.java b/core/src/ch/asynk/tankontank/screens/GameScreen.java
index 7e53900..5b60bcc 100644
--- a/core/src/ch/asynk/tankontank/screens/GameScreen.java
+++ b/core/src/ch/asynk/tankontank/screens/GameScreen.java
@@ -151,7 +151,9 @@ public class GameScreen implements Screen
dragPos.set(x, y);
cam.unproject(touchPos.set(x, y, 0));
map.touchDown(touchPos.x, touchPos.y);
- // map.setPosition(map.getX()-20, map.getY()-20);
+ } else if (button == Input.Buttons.RIGHT) {
+ cam.unproject(touchPos.set(x, y, 0));
+ map.showMoves(touchPos.x, touchPos.y);
}
return true;
}