From df4ea901cc67c389d9327634622a2e83c606a7ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Sun, 30 Nov 2014 00:22:37 +0100 Subject: ObjectiveSet,Map,Hex: visualy differenciate objectives that has to be hold and the others --- android/assets/data/hex-overlays.atlas | 19 +++++++++++++------ android/assets/data/hex-overlays.png | Bin 126149 -> 128366 bytes core/src/ch/asynk/tankontank/game/Hex.java | 7 ++++--- core/src/ch/asynk/tankontank/game/Map.java | 12 +++++------- .../src/ch/asynk/tankontank/game/ObjectiveSet.java | 2 +- data/assets/hex-overlays/06_objective.png | Bin 23747 -> 24482 bytes data/assets/hex-overlays/07_hold_objective.png | Bin 0 -> 23747 bytes data/assets/hex-overlays/07_objective_ge.png | Bin 21616 -> 0 bytes data/assets/hex-overlays/08_objective_ge.png | Bin 0 -> 5861 bytes data/assets/hex-overlays/08_objective_us.png | Bin 28344 -> 0 bytes data/assets/hex-overlays/09_objective_us.png | Bin 0 -> 12159 bytes 11 files changed, 23 insertions(+), 17 deletions(-) create mode 100644 data/assets/hex-overlays/07_hold_objective.png delete mode 100644 data/assets/hex-overlays/07_objective_ge.png create mode 100644 data/assets/hex-overlays/08_objective_ge.png delete mode 100644 data/assets/hex-overlays/08_objective_us.png create mode 100644 data/assets/hex-overlays/09_objective_us.png diff --git a/android/assets/data/hex-overlays.atlas b/android/assets/data/hex-overlays.atlas index f746f9f..72fae15 100644 --- a/android/assets/data/hex-overlays.atlas +++ b/android/assets/data/hex-overlays.atlas @@ -26,7 +26,7 @@ repeat: none index: -1 03_move rotate: false - xy: 810, 330 + xy: 618, 8 size: 100, 114 orig: 100, 114 offset: 0, 0 @@ -52,17 +52,24 @@ repeat: none orig: 190, 217 offset: 0, 0 index: -1 -07_objective_ge +07_hold_objective rotate: false xy: 618, 227 size: 190, 217 orig: 190, 217 offset: 0, 0 index: -1 -08_objective_us +08_objective_ge rotate: false - xy: 618, 8 - size: 190, 217 - orig: 190, 217 + xy: 618, 124 + size: 153, 101 + orig: 153, 101 + offset: 0, 0 + index: -1 +09_objective_us + rotate: false + xy: 810, 346 + size: 153, 98 + orig: 153, 98 offset: 0, 0 index: -1 diff --git a/android/assets/data/hex-overlays.png b/android/assets/data/hex-overlays.png index e4e8150..4a3a8ce 100644 Binary files a/android/assets/data/hex-overlays.png and b/android/assets/data/hex-overlays.png differ diff --git a/core/src/ch/asynk/tankontank/game/Hex.java b/core/src/ch/asynk/tankontank/game/Hex.java index 0abd9d6..6e89df4 100644 --- a/core/src/ch/asynk/tankontank/game/Hex.java +++ b/core/src/ch/asynk/tankontank/game/Hex.java @@ -29,9 +29,10 @@ 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; // unclaimed - public static final int OBJECTIVE_GE= 7; - public static final int OBJECTIVE_US= 8; + public static final int OBJECTIVE = 6; + public static final int OBJECTIVE_HOLD = 7; + public static final int OBJECTIVE_GE = 8; + public static final int OBJECTIVE_US = 9; 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 b059aab..71f29c7 100644 --- a/core/src/ch/asynk/tankontank/game/Map.java +++ b/core/src/ch/asynk/tankontank/game/Map.java @@ -489,11 +489,12 @@ public abstract class Map extends Board 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) + public void showObjective(Hex hex, Army army, boolean hold) { - enableOverlayOn(hex, Hex.OBJECTIVE, false); - enableOverlayOn(hex, Hex.OBJECTIVE_US, false); - enableOverlayOn(hex, Hex.OBJECTIVE_GE, false); + if (hold) + enableOverlayOn(hex, Hex.OBJECTIVE_HOLD, true); + else + enableOverlayOn(hex, Hex.OBJECTIVE, true); } public void showObjective(Hex hex, Army army) @@ -502,18 +503,15 @@ public abstract class Map extends Board 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/core/src/ch/asynk/tankontank/game/ObjectiveSet.java b/core/src/ch/asynk/tankontank/game/ObjectiveSet.java index 2a4f3ee..ab827f6 100644 --- a/core/src/ch/asynk/tankontank/game/ObjectiveSet.java +++ b/core/src/ch/asynk/tankontank/game/ObjectiveSet.java @@ -21,7 +21,7 @@ public class ObjectiveSet extends HashMap implements MoveToAnima public void add(Hex hex, Army army, boolean persistent) { put(hex, new Objective(army, persistent)); - map.showObjective(hex, army); + map.showObjective(hex, army, !persistent); } public int count(Army army) diff --git a/data/assets/hex-overlays/06_objective.png b/data/assets/hex-overlays/06_objective.png index e076771..11e5178 100644 Binary files a/data/assets/hex-overlays/06_objective.png and b/data/assets/hex-overlays/06_objective.png differ diff --git a/data/assets/hex-overlays/07_hold_objective.png b/data/assets/hex-overlays/07_hold_objective.png new file mode 100644 index 0000000..e076771 Binary files /dev/null and b/data/assets/hex-overlays/07_hold_objective.png differ diff --git a/data/assets/hex-overlays/07_objective_ge.png b/data/assets/hex-overlays/07_objective_ge.png deleted file mode 100644 index a88a08e..0000000 Binary files a/data/assets/hex-overlays/07_objective_ge.png and /dev/null differ diff --git a/data/assets/hex-overlays/08_objective_ge.png b/data/assets/hex-overlays/08_objective_ge.png new file mode 100644 index 0000000..076be81 Binary files /dev/null and b/data/assets/hex-overlays/08_objective_ge.png differ diff --git a/data/assets/hex-overlays/08_objective_us.png b/data/assets/hex-overlays/08_objective_us.png deleted file mode 100644 index 156964d..0000000 Binary files a/data/assets/hex-overlays/08_objective_us.png and /dev/null differ diff --git a/data/assets/hex-overlays/09_objective_us.png b/data/assets/hex-overlays/09_objective_us.png new file mode 100644 index 0000000..1f4b754 Binary files /dev/null and b/data/assets/hex-overlays/09_objective_us.png differ -- cgit v1.1-2-g2b99