From 821ec7c94332c29308e7aef671935ac427ecda07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Mon, 4 Jan 2016 14:59:35 +0100 Subject: InfantryFireAnimation: add usage of HALF_WIDTH_P --- .../rustanddust/engine/gfx/animations/InfantryFireAnimation.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/ch/asynk/rustanddust/engine/gfx/animations/InfantryFireAnimation.java b/core/src/ch/asynk/rustanddust/engine/gfx/animations/InfantryFireAnimation.java index 20e1426..dcf5bd7 100644 --- a/core/src/ch/asynk/rustanddust/engine/gfx/animations/InfantryFireAnimation.java +++ b/core/src/ch/asynk/rustanddust/engine/gfx/animations/InfantryFireAnimation.java @@ -104,6 +104,7 @@ public class InfantryFireAnimation implements Disposable, Animation, Pool.Poolab } } + private static final float HALF_WIDTH_P = 0.9f; private static final int SHOT_COUNT = 19; private static final float SHOT_DELAY = (1.6f / SHOT_COUNT); private static final float SHOT_SCATTERING = 40f; @@ -148,8 +149,8 @@ public class InfantryFireAnimation implements Disposable, Animation, Pool.Poolab y0 -= (FireAnimation.infantryFire.height / 2.0f); double r = Math.atan2((y0 - y1), (x0 - x1)); - x0 -= ((float) (Math.cos(r) * halfWidth)); - y0 -= ((float) (Math.sin(r) * halfWidth)); + x0 -= ((float) (Math.cos(r) * halfWidth * HALF_WIDTH_P)); + y0 -= ((float) (Math.sin(r) * halfWidth * HALF_WIDTH_P)); float dx = (x1 - x0); float dy = (y1 - y0); -- cgit v1.1-2-g2b99