summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/rustanddust
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2016-01-04 14:59:35 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2016-01-04 14:59:35 +0100
commit821ec7c94332c29308e7aef671935ac427ecda07 (patch)
tree32805be52308c69e419d816bc64d9d6c60088184 /core/src/ch/asynk/rustanddust
parent354b174c7df1ee7e82e4fdc9be97329a2c720b7a (diff)
downloadRustAndDust-821ec7c94332c29308e7aef671935ac427ecda07.zip
RustAndDust-821ec7c94332c29308e7aef671935ac427ecda07.tar.gz
InfantryFireAnimation: add usage of HALF_WIDTH_P
Diffstat (limited to 'core/src/ch/asynk/rustanddust')
-rw-r--r--core/src/ch/asynk/rustanddust/engine/gfx/animations/InfantryFireAnimation.java5
1 files 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);