diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2015-01-06 11:27:14 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2015-01-06 11:27:14 +0100 |
commit | e4868aebea74bba5ded8d1ec9972d85bb96dd109 (patch) | |
tree | b1268422149e4d5523f60b0dbd09a61e3a6bb6c9 /core/src/ch/asynk | |
parent | 7a3aeabfd8d758944421b71db3e18aacf77bc4de (diff) | |
download | RustAndDust-e4868aebea74bba5ded8d1ec9972d85bb96dd109.zip RustAndDust-e4868aebea74bba5ded8d1ec9972d85bb96dd109.tar.gz |
Map,StatePromote: use ctrl.mapTouch as promote animation start point
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Map.java | 10 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/game/states/StatePromote.java | 2 |
2 files changed, 3 insertions, 9 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java index 2866e4c..fb7c50a 100644 --- a/core/src/ch/asynk/tankontank/game/Map.java +++ b/core/src/ch/asynk/tankontank/game/Map.java @@ -295,19 +295,13 @@ public abstract class Map extends Board activatedUnits.add(unit); } - public void promoteUnit(final Player player, final Unit unit, Position position) + public void promoteUnit(final Player player, final Unit unit) { activatedUnits.add(unit); - // FIXME - float x = 60f; - float y = 60f; - if (position == Position.TOP_RIGHT) - x = getWidth() - 60f; - Hex hex = unit.getHex(); AnimationSequence seq = AnimationSequence.get(2); - seq.addAnimation(PromoteAnimation.get((unit.getArmy() == Army.US), x, y, hex.getX(), hex.getY(), ctrl.cfg.fxVolume)); + seq.addAnimation(PromoteAnimation.get((unit.getArmy() == Army.US), ctrl.mapTouch.x, ctrl.mapTouch.y, hex.getX(), hex.getY(), ctrl.cfg.fxVolume)); seq.addAnimation ( RunnableAnimation.get(unit, new Runnable() { @Override public void run() { diff --git a/core/src/ch/asynk/tankontank/game/states/StatePromote.java b/core/src/ch/asynk/tankontank/game/states/StatePromote.java index 8cf557a..caf781b 100644 --- a/core/src/ch/asynk/tankontank/game/states/StatePromote.java +++ b/core/src/ch/asynk/tankontank/game/states/StatePromote.java @@ -7,7 +7,7 @@ public class StatePromote extends StateCommon @Override public void enter(StateType prevState) { - map.promoteUnit(ctrl.player, selectedUnit, ctrl.battle.getHudPosition(ctrl.player)); + map.promoteUnit(ctrl.player, selectedUnit); ctrl.setAnimationCount(1); ctrl.setAfterAnimationState(StateType.SELECT); ctrl.setState(StateType.ANIMATION); |