From 53d20ed7bd4b1f5badb658fbb053e47c2bccc5f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Thu, 11 Dec 2014 16:28:37 +0100 Subject: Unit: add HAS_FIRED, HAS_MOVED overlay --- android/assets/data/unit-overlays.atlas | 28 +++++++++++++++++++++------- android/assets/data/unit-overlays.png | Bin 66448 -> 71361 bytes assets/unit-overlays/06_fired.png | Bin 0 -> 361 bytes assets/unit-overlays/07_moved.png | Bin 0 -> 353 bytes core/src/ch/asynk/tankontank/game/Unit.java | 10 ++++++++++ 5 files changed, 31 insertions(+), 7 deletions(-) create mode 100644 assets/unit-overlays/06_fired.png create mode 100644 assets/unit-overlays/07_moved.png diff --git a/android/assets/data/unit-overlays.atlas b/android/assets/data/unit-overlays.atlas index 580baa7..fe8f966 100644 --- a/android/assets/data/unit-overlays.atlas +++ b/android/assets/data/unit-overlays.atlas @@ -1,48 +1,62 @@ unit-overlays.png -size: 512,256 +size: 1024,256 format: RGBA8888 filter: Nearest,Nearest repeat: none 00_move rotate: false - xy: 2, 27 + xy: 2, 2 size: 190, 217 orig: 190, 217 offset: 0, 0 index: -1 01_target rotate: false - xy: 194, 2 + xy: 749, 129 size: 90, 90 orig: 90, 90 offset: 0, 0 index: -1 02_fire rotate: false - xy: 194, 94 + xy: 194, 69 size: 100, 150 orig: 100, 150 offset: 0, 0 index: -1 03_may_fire rotate: false - xy: 296, 94 + xy: 296, 69 size: 100, 150 orig: 100, 150 offset: 0, 0 index: -1 04_ace rotate: false - xy: 460, 40 + xy: 712, 15 size: 35, 204 orig: 35, 204 offset: 0, 0 index: -1 05_hq rotate: false - xy: 398, 72 + xy: 650, 47 size: 60, 172 orig: 60, 172 offset: 0, 0 index: -1 +06_fired + rotate: false + xy: 398, 95 + size: 124, 124 + orig: 124, 124 + offset: 0, 0 + index: -1 +07_moved + rotate: false + xy: 524, 95 + size: 124, 124 + orig: 124, 124 + offset: 0, 0 + index: -1 diff --git a/android/assets/data/unit-overlays.png b/android/assets/data/unit-overlays.png index 5949dd1..e581b78 100644 Binary files a/android/assets/data/unit-overlays.png and b/android/assets/data/unit-overlays.png differ diff --git a/assets/unit-overlays/06_fired.png b/assets/unit-overlays/06_fired.png new file mode 100644 index 0000000..b03d25e Binary files /dev/null and b/assets/unit-overlays/06_fired.png differ diff --git a/assets/unit-overlays/07_moved.png b/assets/unit-overlays/07_moved.png new file mode 100644 index 0000000..bc01362 Binary files /dev/null and b/assets/unit-overlays/07_moved.png differ diff --git a/core/src/ch/asynk/tankontank/game/Unit.java b/core/src/ch/asynk/tankontank/game/Unit.java index 0f94cdd..12cac1f 100644 --- a/core/src/ch/asynk/tankontank/game/Unit.java +++ b/core/src/ch/asynk/tankontank/game/Unit.java @@ -19,6 +19,8 @@ public class Unit extends HeadedPawn public static final int MAY_FIRE = 3; public static final int ACE = 4; public static final int HQ = 5; + public static final int HAS_FIRED = 6; + public static final int HAS_MOVED = 7; public static final int FLANK_ATTACK_BONUS = 1; @@ -286,6 +288,7 @@ public class Unit extends HeadedPawn public void setMoved() { hasMoved = true; + showHasMoved(); } @Override @@ -305,6 +308,7 @@ public class Unit extends HeadedPawn { TankOnTank.debug(engagement.toString()); hasFired = true; + showHasFired(); } @Override @@ -314,6 +318,8 @@ public class Unit extends HeadedPawn mpLeft = mp; hasFired = false; hasMoved = false; + hideHasMoved(); + hideHasFired(); } @Override @@ -333,4 +339,8 @@ public class Unit extends HeadedPawn public void hideAttack() { enableOverlay(FIRE, false); } public void showAttackAssist() { enableOverlay(MAY_FIRE, true); } public void hideAttackAssist() { enableOverlay(MAY_FIRE, false); } + public void showHasMoved() { enableOverlay(HAS_MOVED, true); } + public void hideHasMoved() { enableOverlay(HAS_MOVED, false); } + public void showHasFired() { enableOverlay(HAS_FIRED, true); } + public void hideHasFired() { enableOverlay(HAS_FIRED, false); } } -- cgit v1.1-2-g2b99