From a7d1a07962c109521b6fd7b0a495fcce932b8f64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 29 Dec 2015 08:02:59 +0100 Subject: TankFireAnimation: use aim_r to improve shot start position --- .../ch/asynk/rustanddust/engine/gfx/animations/TankFireAnimation.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)); -- cgit v1.1-2-g2b99