summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank/game
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2015-01-06 11:27:14 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2015-01-06 11:27:14 +0100
commite4868aebea74bba5ded8d1ec9972d85bb96dd109 (patch)
treeb1268422149e4d5523f60b0dbd09a61e3a6bb6c9 /core/src/ch/asynk/tankontank/game
parent7a3aeabfd8d758944421b71db3e18aacf77bc4de (diff)
downloadRustAndDust-e4868aebea74bba5ded8d1ec9972d85bb96dd109.zip
RustAndDust-e4868aebea74bba5ded8d1ec9972d85bb96dd109.tar.gz
Map,StatePromote: use ctrl.mapTouch as promote animation start point
Diffstat (limited to 'core/src/ch/asynk/tankontank/game')
-rw-r--r--core/src/ch/asynk/tankontank/game/Map.java10
-rw-r--r--core/src/ch/asynk/tankontank/game/states/StatePromote.java2
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);