summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-11-01 17:44:29 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-11-01 17:44:29 +0100
commita381850e22a186722c646315f594096e1e0f5669 (patch)
treefc0941a52138965c09ab33ecb366362309b48a99
parentaa3dc8940c9ec6ac285e6792433d293b8bdd6069 (diff)
downloadRustAndDust-a381850e22a186722c646315f594096e1e0f5669.zip
RustAndDust-a381850e22a186722c646315f594096e1e0f5669.tar.gz
set new Tile overlays and cleanup usage
-rw-r--r--core/src/ch/asynk/tankontank/game/Hex.java10
-rw-r--r--core/src/ch/asynk/tankontank/game/Map.java22
-rw-r--r--core/src/ch/asynk/tankontank/game/states/StateMove.java5
-rw-r--r--core/src/ch/asynk/tankontank/game/states/StateRotate.java4
-rw-r--r--data/assets/tile-overlays/00_fog.png (renamed from data/assets/tile-overlays/01_fog.png)bin10897 -> 10897 bytes
-rw-r--r--data/assets/tile-overlays/01_select.png (renamed from data/assets/tile-overlays/02_select.png)bin16313 -> 16313 bytes
-rw-r--r--data/assets/tile-overlays/02_area.png (renamed from data/assets/tile-overlays/03_green.png)bin10895 -> 10895 bytes
-rw-r--r--data/assets/tile-overlays/03_move.pngbin0 -> 27747 bytes
-rw-r--r--data/assets/tile-overlays/04_directions.pngbin0 -> 14071 bytes
-rw-r--r--data/assets/tile-overlays/04_red.pngbin10931 -> 0 bytes
-rw-r--r--data/assets/tile-overlays/05_move.pngbin11005 -> 0 bytes
-rw-r--r--data/assets/tile-overlays/05_orientation.pngbin0 -> 691 bytes
-rw-r--r--data/assets/tile-overlays/06_directions.pngbin18135 -> 0 bytes
-rw-r--r--data/assets/tile-overlays/07_assist.pngbin10967 -> 0 bytes
-rw-r--r--data/assets/tile-overlays/08_orientation.pngbin1207 -> 0 bytes
15 files changed, 15 insertions, 26 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Hex.java b/core/src/ch/asynk/tankontank/game/Hex.java
index 4a1e2f5..47048b5 100644
--- a/core/src/ch/asynk/tankontank/game/Hex.java
+++ b/core/src/ch/asynk/tankontank/game/Hex.java
@@ -24,12 +24,10 @@ public class Hex extends Tile
public static final int FOG = 0;
public static final int SELECT = 1;
- public static final int MOVE1 = 2;
- public static final int TARGET = 3;
- public static final int MOVE2 = 4;
- public static final int DIRECTIONS = 5;
- public static final int ASSIST = 6;
- public static final int ORIENTATION = 7;
+ public static final int AREA = 2;
+ public static final int MOVE = 3;
+ public static final int DIRECTIONS = 4;
+ public static final int ORIENTATION = 5;
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 26a7e06..199868f 100644
--- a/core/src/ch/asynk/tankontank/game/Map.java
+++ b/core/src/ch/asynk/tankontank/game/Map.java
@@ -299,16 +299,16 @@ public abstract class Map extends Board
public void togglePathOverlay(Hex hex)
{
- boolean enable= !hex.isOverlayEnabled(Hex.MOVE2);
- enableOverlayOn(hex, Hex.MOVE2, enable);
+ boolean enable= !hex.isOverlayEnabled(Hex.MOVE);
+ enableOverlayOn(hex, Hex.MOVE, enable);
}
- public void showPossibleMoves() { possibleMoves.enable(Hex.MOVE1, true); }
- public void hidePossibleMoves() { possibleMoves.enable(Hex.MOVE1, false); }
- public void showPossiblePaths() { possiblePaths.enable(Hex.MOVE1, true); }
- public void hidePossiblePaths() { possiblePaths.enable(Hex.MOVE1, false); }
- public void showFinalPath(Hex dst) { possiblePaths.enable(Hex.MOVE2, true); }
- public void hideFinalPath(Hex dst) { possiblePaths.enable(Hex.MOVE2, false); }
+ public void showPossibleMoves() { possibleMoves.enable(Hex.AREA, true); }
+ public void hidePossibleMoves() { possibleMoves.enable(Hex.AREA, false); }
+ public void showPossiblePaths() { possiblePaths.enable(Hex.AREA, true); }
+ public void hidePossiblePaths() { possiblePaths.enable(Hex.AREA, false); }
+ public void showFinalPath(Hex dst) { possiblePaths.enable(Hex.MOVE, true); showMove(dst); }
+ public void hideFinalPath(Hex dst) { possiblePaths.enable(Hex.MOVE, false); hideMove(dst); }
public void showMoveablePawns() { moveablePawns.enable(Unit.MOVE, true); }
public void hideMoveablePawns() { moveablePawns.enable(Unit.MOVE, false); }
@@ -323,12 +323,10 @@ public abstract class Map extends Board
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); }
+ public void hideMove(Hex hex) { enableOverlayOn(hex, Hex.MOVE, false); }
public void showDirections(Hex hex) { enableOverlayOn(hex, Hex.DIRECTIONS, true); }
public void hideDirections(Hex hex) { enableOverlayOn(hex, Hex.DIRECTIONS, false); }
- public void showTarget(Hex hex) { enableOverlayOn(hex, Hex.TARGET, true); }
- public void hideTarget(Hex hex) { enableOverlayOn(hex, Hex.TARGET, false); }
- public void showAssist(Hex hex) { enableOverlayOn(hex, Hex.ASSIST, true); }
- public void hideAssist(Hex hex) { enableOverlayOn(hex, Hex.ASSIST, false); }
public void showOrientation(Hex hex, Orientation o) { enableOverlayOn(hex, Hex.ORIENTATION, o, true); }
public void hideOrientation(Hex hex) { enableOverlayOn(hex, Hex.ORIENTATION, false); }
}
diff --git a/core/src/ch/asynk/tankontank/game/states/StateMove.java b/core/src/ch/asynk/tankontank/game/states/StateMove.java
index f1e09f8..e2ba7da 100644
--- a/core/src/ch/asynk/tankontank/game/states/StateMove.java
+++ b/core/src/ch/asynk/tankontank/game/states/StateMove.java
@@ -42,7 +42,6 @@ public class StateMove extends StateCommon
map.hidePossibleMoves();
map.unselectHex(activeUnit.getHex());
if (to != null) {
- map.unselectHex(to);
map.hideFinalPath(to);
}
@@ -99,7 +98,6 @@ public class StateMove extends StateCommon
private void hideAssists()
{
- map.hideAssist(selectedHex);
map.hideMoveablePawns();
}
@@ -110,7 +108,6 @@ public class StateMove extends StateCommon
activeUnit = unit;
Hex hex = activeUnit.getHex();
map.selectHex(hex);
- map.hideAssist(hex);
activeUnit.showMoveable();
map.hidePossibleMoves();
map.collectPossibleMoves(activeUnit);
@@ -121,7 +118,7 @@ public class StateMove extends StateCommon
{
to = upHex;
int s = map.collectPossiblePaths(activeUnit, to);
- map.selectHex(to);
+ map.showMove(to);
map.hidePossibleMoves();
map.showPossiblePaths();
return s;
diff --git a/core/src/ch/asynk/tankontank/game/states/StateRotate.java b/core/src/ch/asynk/tankontank/game/states/StateRotate.java
index 975a8d5..9c856fb 100644
--- a/core/src/ch/asynk/tankontank/game/states/StateRotate.java
+++ b/core/src/ch/asynk/tankontank/game/states/StateRotate.java
@@ -25,8 +25,6 @@ public class StateRotate extends StateCommon
} else {
if (to == null)
System.err.println("to is null but should not be");
- // show final path
- map.selectHex(to);
map.showFinalPath(to);
}
@@ -39,7 +37,6 @@ public class StateRotate extends StateCommon
@Override
public void leave(StateType nextState)
{
- map.unselectHex(to);
map.unselectHex(activeUnit.getHex());
map.hideFinalPath(to);
map.hideDirections(to);
@@ -96,7 +93,6 @@ public class StateRotate extends StateCommon
private void hideAssists()
{
map.hideMoveablePawns();
- map.hideAssist(selectedHex);
}
private void doRotation(Orientation o)
diff --git a/data/assets/tile-overlays/01_fog.png b/data/assets/tile-overlays/00_fog.png
index 7d85d98..7d85d98 100644
--- a/data/assets/tile-overlays/01_fog.png
+++ b/data/assets/tile-overlays/00_fog.png
Binary files differ
diff --git a/data/assets/tile-overlays/02_select.png b/data/assets/tile-overlays/01_select.png
index f0b4320..f0b4320 100644
--- a/data/assets/tile-overlays/02_select.png
+++ b/data/assets/tile-overlays/01_select.png
Binary files differ
diff --git a/data/assets/tile-overlays/03_green.png b/data/assets/tile-overlays/02_area.png
index 78b8f75..78b8f75 100644
--- a/data/assets/tile-overlays/03_green.png
+++ b/data/assets/tile-overlays/02_area.png
Binary files differ
diff --git a/data/assets/tile-overlays/03_move.png b/data/assets/tile-overlays/03_move.png
new file mode 100644
index 0000000..5303cce
--- /dev/null
+++ b/data/assets/tile-overlays/03_move.png
Binary files differ
diff --git a/data/assets/tile-overlays/04_directions.png b/data/assets/tile-overlays/04_directions.png
new file mode 100644
index 0000000..6d483e1
--- /dev/null
+++ b/data/assets/tile-overlays/04_directions.png
Binary files differ
diff --git a/data/assets/tile-overlays/04_red.png b/data/assets/tile-overlays/04_red.png
deleted file mode 100644
index 1320f4a..0000000
--- a/data/assets/tile-overlays/04_red.png
+++ /dev/null
Binary files differ
diff --git a/data/assets/tile-overlays/05_move.png b/data/assets/tile-overlays/05_move.png
deleted file mode 100644
index e0204a9..0000000
--- a/data/assets/tile-overlays/05_move.png
+++ /dev/null
Binary files differ
diff --git a/data/assets/tile-overlays/05_orientation.png b/data/assets/tile-overlays/05_orientation.png
new file mode 100644
index 0000000..2b1d06d
--- /dev/null
+++ b/data/assets/tile-overlays/05_orientation.png
Binary files differ
diff --git a/data/assets/tile-overlays/06_directions.png b/data/assets/tile-overlays/06_directions.png
deleted file mode 100644
index fd9c7b7..0000000
--- a/data/assets/tile-overlays/06_directions.png
+++ /dev/null
Binary files differ
diff --git a/data/assets/tile-overlays/07_assist.png b/data/assets/tile-overlays/07_assist.png
deleted file mode 100644
index e9c7674..0000000
--- a/data/assets/tile-overlays/07_assist.png
+++ /dev/null
Binary files differ
diff --git a/data/assets/tile-overlays/08_orientation.png b/data/assets/tile-overlays/08_orientation.png
deleted file mode 100644
index a808589..0000000
--- a/data/assets/tile-overlays/08_orientation.png
+++ /dev/null
Binary files differ