diff options
Diffstat (limited to 'core/src/ch')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Hud.java | 12 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/game/states/StateAttack.java | 4 |
2 files changed, 12 insertions, 4 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Hud.java b/core/src/ch/asynk/tankontank/game/Hud.java index a3d782b..6155cac 100644 --- a/core/src/ch/asynk/tankontank/game/Hud.java +++ b/core/src/ch/asynk/tankontank/game/Hud.java @@ -91,14 +91,20 @@ public class Hud implements Disposable msg.draw(batch); } + public void pushNotify(String s) + { + notify(s, 1, Position.MIDDLE_CENTER, true); + } + public void notify(String s) { - msg.write(s, 1, Position.MIDDLE_CENTER); + notify(s, 1, Position.MIDDLE_CENTER, false); } - public void notify(String s, Position position) + public void notify(String s, float duration, Position position, boolean push) { - msg.write(s, 1, position); + if (push) msg.pushWrite(s, duration, position); + else msg.write(s, 1, position); } private float setButton(Button btn, float x, float y) diff --git a/core/src/ch/asynk/tankontank/game/states/StateAttack.java b/core/src/ch/asynk/tankontank/game/states/StateAttack.java index 90112c7..cba908f 100644 --- a/core/src/ch/asynk/tankontank/game/states/StateAttack.java +++ b/core/src/ch/asynk/tankontank/game/states/StateAttack.java @@ -87,8 +87,10 @@ public class StateAttack extends StateCommon if (map.attackPawn(selectedUnit, activeUnit, d1, d2)) { ctrl.hud.notify(selectedUnit.attack.calculus + " : " + activeUnit + " is destroyed"); ctrl.opponent.casualty(activeUnit); - if (map.breakPawns.size() > 0) + if (map.breakPawns.size() > 0) { + ctrl.hud.pushNotify("Break move possible"); setNextState(StateType.BREAK); + } } else ctrl.hud.notify(selectedUnit.attack.calculus + " : failure"); |