diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-06 17:14:21 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-06 17:14:21 +0200 |
commit | 6a96f4f802b241159c4c9e431658959ee87852d4 (patch) | |
tree | 7ba40fa2f4adc88d6bec8b96c1096e4eb564a24e /core/src/ch/asynk | |
parent | 298ddb56e9cdb6c21eeaa4ceffa02381c883ee7c (diff) | |
download | RustAndDust-6a96f4f802b241159c4c9e431658959ee87852d4.zip RustAndDust-6a96f4f802b241159c4c9e431658959ee87852d4.tar.gz |
GameStateMove: must clear possible paths first, keep previously selected pawn
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/states/GameStateMove.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/core/src/ch/asynk/tankontank/game/states/GameStateMove.java b/core/src/ch/asynk/tankontank/game/states/GameStateMove.java index 2bdf52f..2e05e89 100644 --- a/core/src/ch/asynk/tankontank/game/states/GameStateMove.java +++ b/core/src/ch/asynk/tankontank/game/states/GameStateMove.java @@ -9,15 +9,27 @@ public class GameStateMove extends GameStateCommon private GridPoint2 to = new GridPoint2(-1, -1); @Override + public void enter() + { + map.enablePossibleTargets(false); + map.enablePossiblePaths(false, false); + if (pawn != null) { + skipFirst = false; + map.clearPossiblePaths(); + map.buildAndShowPossibleMoves(pawn, hex); + } + } + + @Override public void touchDown() { if (pawn == null) { super.touchDown(); if (hexHasUnit()) { - // TODO maybe keep the the previous hex // FIXME must be one of it's own setPawn(); skipFirst = true; + map.clearPossiblePaths(); map.buildAndShowPossibleMoves(pawn, hex); } } |