summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-10-14 18:59:04 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2014-10-14 18:59:04 +0200
commit7d2af8ef387acb34b82d44610b6ac79724aade21 (patch)
tree7c5cc9ce54565ef6818a6d7766517b9bdf72fe54 /core/src/ch/asynk
parente4c5fe9da98ce89b9cd44cfdc59e2e3dd26f5915 (diff)
downloadRustAndDust-7d2af8ef387acb34b82d44610b6ac79724aade21.zip
RustAndDust-7d2af8ef387acb34b82d44610b6ac79724aade21.tar.gz
Click on Flag to end current player's turn
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r--core/src/ch/asynk/tankontank/game/Ctrl.java6
-rw-r--r--core/src/ch/asynk/tankontank/game/Hud.java5
2 files changed, 10 insertions, 1 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Ctrl.java b/core/src/ch/asynk/tankontank/game/Ctrl.java
index 6ef8eed..a3dafc9 100644
--- a/core/src/ch/asynk/tankontank/game/Ctrl.java
+++ b/core/src/ch/asynk/tankontank/game/Ctrl.java
@@ -159,6 +159,12 @@ public class Ctrl implements Disposable
nextPlayer();
}
+ public void endTurn()
+ {
+ state.abort();
+ nextPlayer();
+ }
+
public void abort()
{
state.abort();
diff --git a/core/src/ch/asynk/tankontank/game/Hud.java b/core/src/ch/asynk/tankontank/game/Hud.java
index d50d8a7..278643e 100644
--- a/core/src/ch/asynk/tankontank/game/Hud.java
+++ b/core/src/ch/asynk/tankontank/game/Hud.java
@@ -168,7 +168,10 @@ public class Hud implements Disposable
if (btn != null)
btn.setOn();
- if (infoRect.contains(x,y)) return true;
+ if (infoRect.contains(x,y)) {
+ ctrl.endTurn();
+ return true;
+ }
if (!buttonsRect.contains(x,y)) return false;
if (btn == moveBtn)