summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-10-03 11:51:34 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2014-10-03 11:51:34 +0200
commitca2e19375c9a28f3c15262c413166d11c3a9e3bb (patch)
tree29e0155c1855e230f72b2d793c8e380631c39d2e
parentc4fd1a79b9cc2a27448c7631cbd46f701115c8e5 (diff)
downloadRustAndDust-ca2e19375c9a28f3c15262c413166d11c3a9e3bb.zip
RustAndDust-ca2e19375c9a28f3c15262c413166d11c3a9e3bb.tar.gz
remove debug output
-rw-r--r--core/src/ch/asynk/tankontank/engine/Board.java1
-rw-r--r--core/src/ch/asynk/tankontank/game/GameStateDirection.java29
-rw-r--r--core/src/ch/asynk/tankontank/game/GameStatePath.java3
3 files changed, 30 insertions, 3 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Board.java b/core/src/ch/asynk/tankontank/engine/Board.java
index cdc8504..d6ee64d 100644
--- a/core/src/ch/asynk/tankontank/engine/Board.java
+++ b/core/src/ch/asynk/tankontank/engine/Board.java
@@ -345,7 +345,6 @@ public abstract class Board implements Disposable
for (int i = (nodes.size() - 1); i >= 0; i--) {
SearchBoard.Node node = nodes.get(i);
- System.out.println(node.col+" "+node.row);
if (prevVector == null) {
Vector3 p = pawn.getLastPosition();
diff --git a/core/src/ch/asynk/tankontank/game/GameStateDirection.java b/core/src/ch/asynk/tankontank/game/GameStateDirection.java
index 5b98e39..a65c742 100644
--- a/core/src/ch/asynk/tankontank/game/GameStateDirection.java
+++ b/core/src/ch/asynk/tankontank/game/GameStateDirection.java
@@ -1,6 +1,8 @@
package ch.asynk.tankontank.game;
-public class GameStateDirection implements GameState
+import ch.asynk.tankontank.engine.Orientation;
+
+public class GameStateDirection extends GameStateCommon
{
@Override
public void touchDown()
@@ -10,5 +12,30 @@ public class GameStateDirection implements GameState
@Override
public void touchUp()
{
+ Orientation o = Orientation.KEEP;;
+ if (downHex.y == hex.y) {
+ if (downHex.x == (hex.x - 1)) {
+ o = Orientation.SOUTH;
+ } else if (downHex.x == (hex.x + 1)) {
+ o = Orientation.NORTH;
+ }
+ } else if (downHex.y == (hex.y - 1)) {
+ if (downHex.x == (hex.x - 1)) {
+ o = Orientation.SOUTH_EAST;
+ } else if (downHex.x == hex.x) {
+ o = Orientation.NORTH_EAST;
+ }
+
+ } else if (downHex.y == (hex.y + 1)) {
+ if (downHex.x == hex.x) {
+ o = Orientation.SOUTH_WEST;
+ } else if (downHex.x == (hex.x + 1)) {
+ o = Orientation.NORTH_WEST;
+ }
+ }
+
+ if (o != Orientation.KEEP) {
+ map.movePawn(pawn, o);
+ }
}
}
diff --git a/core/src/ch/asynk/tankontank/game/GameStatePath.java b/core/src/ch/asynk/tankontank/game/GameStatePath.java
index c13c14a..5bd3964 100644
--- a/core/src/ch/asynk/tankontank/game/GameStatePath.java
+++ b/core/src/ch/asynk/tankontank/game/GameStatePath.java
@@ -22,8 +22,9 @@ public class GameStatePath extends GameStateCommon
}
if (s == 1) {
+ hex.set(to.x, to.y);
map.enableFinalPath(to, true);
- ctrl.setState(State.DIRECTION, true);
+ ctrl.setState(State.DIRECTION, false);
}
}