summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2015-12-29 08:02:59 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2015-12-29 08:02:59 +0100
commita7d1a07962c109521b6fd7b0a495fcce932b8f64 (patch)
tree530cda8bad1156216598622e341b5276d2ac90ae
parentf9ced3fff597baf93b46db4e1068d923e308b0e3 (diff)
downloadRustAndDust-a7d1a07962c109521b6fd7b0a495fcce932b8f64.zip
RustAndDust-a7d1a07962c109521b6fd7b0a495fcce932b8f64.tar.gz
TankFireAnimation: use aim_r to improve shot start position
-rw-r--r--core/src/ch/asynk/rustanddust/engine/gfx/animations/TankFireAnimation.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/src/ch/asynk/rustanddust/engine/gfx/animations/TankFireAnimation.java b/core/src/ch/asynk/rustanddust/engine/gfx/animations/TankFireAnimation.java
index 8584a79..ef23a6b 100644
--- a/core/src/ch/asynk/rustanddust/engine/gfx/animations/TankFireAnimation.java
+++ b/core/src/ch/asynk/rustanddust/engine/gfx/animations/TankFireAnimation.java
@@ -79,7 +79,7 @@ public class TankFireAnimation implements Disposable, Animation, Pool.Poolable
this.aim_r = (float) (Math.toDegrees(Math.atan2((y0 - y1), (x0 - x1))));
// fire geometry
- y0 -= (FireAnimation.tankFire.height / 2.0f);
+ y0 += (((Math.abs(aim_r) > 90) ? 1 : -1) * (FireAnimation.tankFire.height / 2.0f));
x1 += ((SHOT_SCATTERING * FireAnimation.random.nextFloat()) - (SHOT_SCATTERING / 2f));
y1 += ((SHOT_SCATTERING * FireAnimation.random.nextFloat()) - (SHOT_SCATTERING / 2f));