From bb484b079fca679bf5fbf61439b6e1039cffac16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Fri, 21 Nov 2014 17:01:33 +0100 Subject: Hex.OBJECTIVE_GE and Hex.OBJECTIVE_US --- android/assets/data/tile-overlays.atlas | 14 +++++++++++ android/assets/data/tile-overlays.png | Bin 104203 -> 148404 bytes core/src/ch/asynk/tankontank/game/Hex.java | 4 +++- core/src/ch/asynk/tankontank/game/Map.java | 32 +++++++++++++++++++++++--- data/assets/tile-overlays/07_objective_ge.png | Bin 0 -> 21616 bytes data/assets/tile-overlays/08_objective_us.png | Bin 0 -> 28344 bytes 6 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 data/assets/tile-overlays/07_objective_ge.png create mode 100644 data/assets/tile-overlays/08_objective_us.png diff --git a/android/assets/data/tile-overlays.atlas b/android/assets/data/tile-overlays.atlas index e2821ed..b466065 100644 --- a/android/assets/data/tile-overlays.atlas +++ b/android/assets/data/tile-overlays.atlas @@ -52,3 +52,17 @@ repeat: none orig: 190, 217 offset: 0, 0 index: -1 +07_objective_ge + rotate: false + xy: 618, 48 + size: 190, 217 + orig: 190, 217 + offset: 0, 0 + index: -1 +08_objective_us + rotate: false + xy: 810, 267 + size: 190, 217 + orig: 190, 217 + offset: 0, 0 + index: -1 diff --git a/android/assets/data/tile-overlays.png b/android/assets/data/tile-overlays.png index 10c9a3c..843ac93 100644 Binary files a/android/assets/data/tile-overlays.png and b/android/assets/data/tile-overlays.png differ diff --git a/core/src/ch/asynk/tankontank/game/Hex.java b/core/src/ch/asynk/tankontank/game/Hex.java index 63f4422..019e02f 100644 --- a/core/src/ch/asynk/tankontank/game/Hex.java +++ b/core/src/ch/asynk/tankontank/game/Hex.java @@ -29,7 +29,9 @@ public class Hex extends Tile public static final int MOVE = 3; public static final int DIRECTIONS = 4; public static final int ORIENTATION = 5; - public static final int OBJECTIVE = 6; + public static final int OBJECTIVE = 6; // unclaimed + public static final int OBJECTIVE_GE= 7; + public static final int OBJECTIVE_US= 8; public Terrain terrain; public int roads; diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java index 878a7e3..15f73c8 100644 --- a/core/src/ch/asynk/tankontank/game/Map.java +++ b/core/src/ch/asynk/tankontank/game/Map.java @@ -380,9 +380,6 @@ public abstract class Map extends Board public void showPath(Hex dst) { possiblePaths.enable(Hex.MOVE, true); showMove(dst); } public void hidePath(Hex dst) { possiblePaths.enable(Hex.MOVE, false); hideMove(dst); } - public void showObjective(Hex hex) { enableOverlayOn(hex, Hex.OBJECTIVE, true); } - public void hideObjective(Hex hex) { enableOverlayOn(hex, Hex.OBJECTIVE, true); } - public void selectHex(Hex hex) { enableOverlayOn(hex, Hex.SELECT, true); } public void unselectHex(Hex hex) { enableOverlayOn(hex, Hex.SELECT, false); } public void showMove(Hex hex) { enableOverlayOn(hex, Hex.MOVE, true); } @@ -391,4 +388,33 @@ public abstract class Map extends Board public void hideDirections(Hex hex) { enableOverlayOn(hex, Hex.DIRECTIONS, false); } public void showOrientation(Hex hex, Orientation o) { enableOverlayOn(hex, Hex.ORIENTATION, o, true); } public void hideOrientation(Hex hex) { enableOverlayOn(hex, Hex.ORIENTATION, false); } + + public void hideObjective(Hex hex) + { + enableOverlayOn(hex, Hex.OBJECTIVE, false); + enableOverlayOn(hex, Hex.OBJECTIVE_US, false); + enableOverlayOn(hex, Hex.OBJECTIVE_GE, false); + } + + public void showObjective(Hex hex, Army army) + { + switch(army) { + case GE: + enableOverlayOn(hex, Hex.OBJECTIVE_GE, true); + enableOverlayOn(hex, Hex.OBJECTIVE_US, false); + enableOverlayOn(hex, Hex.OBJECTIVE, false); + break; + case US: + enableOverlayOn(hex, Hex.OBJECTIVE_GE, false); + enableOverlayOn(hex, Hex.OBJECTIVE_US, true); + enableOverlayOn(hex, Hex.OBJECTIVE, false); + break; + case NONE: + default: + enableOverlayOn(hex, Hex.OBJECTIVE_GE, false); + enableOverlayOn(hex, Hex.OBJECTIVE_US, false); + enableOverlayOn(hex, Hex.OBJECTIVE, true); + break; + } + } } diff --git a/data/assets/tile-overlays/07_objective_ge.png b/data/assets/tile-overlays/07_objective_ge.png new file mode 100644 index 0000000..a88a08e Binary files /dev/null and b/data/assets/tile-overlays/07_objective_ge.png differ diff --git a/data/assets/tile-overlays/08_objective_us.png b/data/assets/tile-overlays/08_objective_us.png new file mode 100644 index 0000000..156964d Binary files /dev/null and b/data/assets/tile-overlays/08_objective_us.png differ -- cgit v1.1-2-g2b99