summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank/game
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-11-15 16:06:53 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-11-15 16:06:53 +0100
commite29f3553e3ab34b06ec657cdd0444d9f813599a3 (patch)
treee444d7ddae6fbd141e30faf289ca1d56c1fb4677 /core/src/ch/asynk/tankontank/game
parent8919200e69f7972813de1a8e73f3159274227aa8 (diff)
downloadRustAndDust-e29f3553e3ab34b06ec657cdd0444d9f813599a3.zip
RustAndDust-e29f3553e3ab34b06ec657cdd0444d9f813599a3.tar.gz
Player: getAp() never returns a value > action points
Diffstat (limited to 'core/src/ch/asynk/tankontank/game')
-rw-r--r--core/src/ch/asynk/tankontank/game/Player.java2
-rw-r--r--core/src/ch/asynk/tankontank/game/hud/Bg.java1
2 files changed, 2 insertions, 1 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Player.java b/core/src/ch/asynk/tankontank/game/Player.java
index d7b26f2..b8fed22 100644
--- a/core/src/ch/asynk/tankontank/game/Player.java
+++ b/core/src/ch/asynk/tankontank/game/Player.java
@@ -45,7 +45,7 @@ public class Player extends ch.asynk.tankontank.engine.Player
public int getAp()
{
- return (apSpent + 1);
+ return ((apSpent < actionPoints) ? (apSpent + 1) : apSpent);
}
public int getTurn()
diff --git a/core/src/ch/asynk/tankontank/game/hud/Bg.java b/core/src/ch/asynk/tankontank/game/hud/Bg.java
index 5679d57..411683a 100644
--- a/core/src/ch/asynk/tankontank/game/hud/Bg.java
+++ b/core/src/ch/asynk/tankontank/game/hud/Bg.java
@@ -22,6 +22,7 @@ public class Bg extends Widget
@Override
public void draw(Batch batch)
{
+ if (!visible) return;
batch.draw(region, rect.x, rect.y, rect.width, rect.height);
}
}