summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-10-07 20:57:13 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2014-10-07 20:57:13 +0200
commitcb8e7a5f09fadca472910fc435c307e2cff77aac (patch)
tree6de96e6e8f4533dab720cc9be493f83e16f9cf63
parent0825ba66e14db1ff93c5b62da89cac856bf24266 (diff)
downloadRustAndDust-cb8e7a5f09fadca472910fc435c307e2cff77aac.zip
RustAndDust-cb8e7a5f09fadca472910fc435c307e2cff77aac.tar.gz
GameStateMove: show assist moves, clear correctly
-rw-r--r--core/src/ch/asynk/tankontank/game/states/GameStateMove.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/core/src/ch/asynk/tankontank/game/states/GameStateMove.java b/core/src/ch/asynk/tankontank/game/states/GameStateMove.java
index bc6e535..daf5b3c 100644
--- a/core/src/ch/asynk/tankontank/game/states/GameStateMove.java
+++ b/core/src/ch/asynk/tankontank/game/states/GameStateMove.java
@@ -1,12 +1,8 @@
package ch.asynk.tankontank.game.states;
-import com.badlogic.gdx.math.GridPoint2;
-
public class GameStateMove extends GameStateCommon
{
private boolean skipFirst;
- private GridPoint2 from = new GridPoint2(-1, -1);
- private GridPoint2 to = new GridPoint2(-1, -1);
@Override
public void enter()
@@ -18,6 +14,7 @@ public class GameStateMove extends GameStateCommon
skipFirst = false;
map.clearPossiblePaths();
map.buildAndShowPossibleMoves(pawn, hex);
+ map.buildAndShowMoveAssist(pawn, hex);
}
}
@@ -30,6 +27,7 @@ public class GameStateMove extends GameStateCommon
skipFirst = true;
map.clearPossiblePaths();
map.buildAndShowPossibleMoves(pawn, hex);
+ map.buildAndShowMoveAssist(pawn, hex);
}
}
}
@@ -67,6 +65,10 @@ public class GameStateMove extends GameStateCommon
@Override
public void abort()
{
+ map.enableMoveAssist(false);
+ map.enablePossibleMoves(false);
+ if (to.x != -1) unselectHex(to);
+ if (from.x != -1) unselectHex(to);
to.set(-1, -1);
from.set(-1, -1);
super.abort();
@@ -78,7 +80,7 @@ public class GameStateMove extends GameStateCommon
to.set(upHex.x, upHex.y);
map.clearPossiblePaths();
int s = map.buildPossiblePaths(pawn, from, to);
- selectHex(downHex);
+ selectHex(to);
map.enablePossibleMoves(false);
map.enablePossiblePaths(true, true);
return s;