diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-12-01 01:42:17 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-12-01 01:42:17 +0100 |
commit | bbf83bf49aee9b5c1a0485393783a75454aca0e1 (patch) | |
tree | 5e7d76a88e27e525df468e57cf6395bdb535b1c8 /core/src/ch/asynk/tankontank/game/hud | |
parent | 4b73055612c8a15fcd85482a8fa81185c01a2731 (diff) | |
download | RustAndDust-bbf83bf49aee9b5c1a0485393783a75454aca0e1.zip RustAndDust-bbf83bf49aee9b5c1a0485393783a75454aca0e1.tar.gz |
Engagement: keep original flag size for winner flag
Diffstat (limited to 'core/src/ch/asynk/tankontank/game/hud')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/hud/Engagement.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/core/src/ch/asynk/tankontank/game/hud/Engagement.java b/core/src/ch/asynk/tankontank/game/hud/Engagement.java index 2f6565b..5ad6a2a 100644 --- a/core/src/ch/asynk/tankontank/game/hud/Engagement.java +++ b/core/src/ch/asynk/tankontank/game/hud/Engagement.java @@ -17,6 +17,8 @@ public class Engagement extends Bg public float padding; private Sprite usFlag; private Sprite geFlag; + private Sprite geWinner; + private Sprite usWinner; private Sprite winner; private Label attack; private Label defense; @@ -31,7 +33,8 @@ public class Engagement extends Bg super(region); usFlag = new Sprite(atlas.findRegion("us-flag")); geFlag = new Sprite(atlas.findRegion("ge-flag")); - winner = new Sprite(); + usWinner = new Sprite(usFlag); + geWinner = new Sprite(geFlag); usFlag.setSize(usFlag.getWidth() * (FLAG_HEIGHT / usFlag.getHeight()), FLAG_HEIGHT); geFlag.setSize(geFlag.getWidth() * (FLAG_HEIGHT / geFlag.getHeight()), FLAG_HEIGHT); this.attack = new Label(font); @@ -53,9 +56,9 @@ public class Engagement extends Bg attackR.write(String.format("= %d", e.attack)); defenseR.write(String.format("= %d", e.defense)); if (e.success) - winner.set((e.attacker == Army.US) ? usFlag : geFlag); + winner = ((e.attacker == Army.US) ? usWinner : geWinner); else - winner.set((e.attacker == Army.US) ? geFlag : usFlag); + winner = ((e.attacker == Army.US) ? geWinner : usWinner); float resultW = attackR.getWidth(); float w = defenseR.getWidth(); |