summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-12-11 16:28:37 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-12-11 16:28:37 +0100
commit53d20ed7bd4b1f5badb658fbb053e47c2bccc5f7 (patch)
treeef5fdc7348a4d3d2a5d4d491dd44d2445a91d061
parent2cd0902108208bf6eabb876c194891ba14151966 (diff)
downloadRustAndDust-53d20ed7bd4b1f5badb658fbb053e47c2bccc5f7.zip
RustAndDust-53d20ed7bd4b1f5badb658fbb053e47c2bccc5f7.tar.gz
Unit: add HAS_FIRED, HAS_MOVED overlay
-rw-r--r--android/assets/data/unit-overlays.atlas28
-rw-r--r--android/assets/data/unit-overlays.pngbin66448 -> 71361 bytes
-rw-r--r--assets/unit-overlays/06_fired.pngbin0 -> 361 bytes
-rw-r--r--assets/unit-overlays/07_moved.pngbin0 -> 353 bytes
-rw-r--r--core/src/ch/asynk/tankontank/game/Unit.java10
5 files changed, 31 insertions, 7 deletions
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
--- a/android/assets/data/unit-overlays.png
+++ b/android/assets/data/unit-overlays.png
Binary files differ
diff --git a/assets/unit-overlays/06_fired.png b/assets/unit-overlays/06_fired.png
new file mode 100644
index 0000000..b03d25e
--- /dev/null
+++ b/assets/unit-overlays/06_fired.png
Binary files differ
diff --git a/assets/unit-overlays/07_moved.png b/assets/unit-overlays/07_moved.png
new file mode 100644
index 0000000..bc01362
--- /dev/null
+++ b/assets/unit-overlays/07_moved.png
Binary files 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); }
}