diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-01 18:30:03 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-01 18:30:03 +0100 |
commit | f8ce9bff9796a912a63d8c513a351f6c116883f5 (patch) | |
tree | 6b8cdfd2b86d865ee58c3979b63e2c1a22e38e04 | |
parent | 521b33232bba647b205e6f3b09af38b0b3153389 (diff) | |
download | RustAndDust-f8ce9bff9796a912a63d8c513a351f6c116883f5.zip RustAndDust-f8ce9bff9796a912a63d8c513a351f6c116883f5.tar.gz |
Hup,StateAttack: support and use Msg.pushWrite(...)
-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"); |