summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank/engine/gfx
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-12-04 15:31:20 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-12-04 15:31:20 +0100
commitdc29b2e00bbd6461ce643f5f985c0d51c7191577 (patch)
tree976aa9cc96b7c6421d345c7f6b2d1e04db250fb5 /core/src/ch/asynk/tankontank/engine/gfx
parent5478be45d1edb033159846fda6488c819aa77b82 (diff)
downloadRustAndDust-dc29b2e00bbd6461ce643f5f985c0d51c7191577.zip
RustAndDust-dc29b2e00bbd6461ce643f5f985c0d51c7191577.tar.gz
TankFireAnimation,InfantryFireAnimation: offset -> halfWidth
Diffstat (limited to 'core/src/ch/asynk/tankontank/engine/gfx')
-rw-r--r--core/src/ch/asynk/tankontank/engine/gfx/animations/InfantryFireAnimation.java10
-rw-r--r--core/src/ch/asynk/tankontank/engine/gfx/animations/TankFireAnimation.java10
2 files changed, 10 insertions, 10 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/gfx/animations/InfantryFireAnimation.java b/core/src/ch/asynk/tankontank/engine/gfx/animations/InfantryFireAnimation.java
index 3ab8642..3327680 100644
--- a/core/src/ch/asynk/tankontank/engine/gfx/animations/InfantryFireAnimation.java
+++ b/core/src/ch/asynk/tankontank/engine/gfx/animations/InfantryFireAnimation.java
@@ -63,10 +63,10 @@ public class InfantryFireAnimation implements Disposable, Animation, Pool.Poolab
}
};
- public static InfantryFireAnimation get(float volume, float offset, float x0, float y0, float x1, float y1)
+ public static InfantryFireAnimation get(float volume, float x0, float y0, float x1, float y1, float halfWidth)
{
InfantryFireAnimation a = fireAnimationPool.obtain();
- a.set(volume, offset, x0, y0, x1, y1);
+ a.set(volume, x0, y0, x1, y1, halfWidth);
return a;
}
@@ -77,7 +77,7 @@ public class InfantryFireAnimation implements Disposable, Animation, Pool.Poolab
shots[i] = new Shot(new TextureRegion(FireAnimation.infantryFire.frames[0]));
}
- private void set(float volume, float offset, float _x0, float _y0, float _x1, float _y1)
+ private void set(float volume, float x0, float y0, float x1, float y1, float halfWidth)
{
this.volume = volume;
this.elapsed = 0f;
@@ -90,8 +90,8 @@ public class InfantryFireAnimation implements Disposable, Animation, Pool.Poolab
float y1 = (_y1 + ((SHOT_SCATTERING * FireAnimation.random.nextFloat()) - (SHOT_SCATTERING / 2f)));
double r = Math.atan2((y0 - y1), (x0 - x1));
- float xadj = (float) (Math.cos(r) * offset);
- float yadj = (float) (Math.sin(r) * offset);
+ float xadj = (float) (Math.cos(r) * halfWidth);
+ float yadj = (float) (Math.sin(r) * halfWidth);
x0 -= xadj;
y0 -= yadj;
diff --git a/core/src/ch/asynk/tankontank/engine/gfx/animations/TankFireAnimation.java b/core/src/ch/asynk/tankontank/engine/gfx/animations/TankFireAnimation.java
index a96bcc2..8411bac 100644
--- a/core/src/ch/asynk/tankontank/engine/gfx/animations/TankFireAnimation.java
+++ b/core/src/ch/asynk/tankontank/engine/gfx/animations/TankFireAnimation.java
@@ -53,10 +53,10 @@ public class TankFireAnimation implements Disposable, Animation, Pool.Poolable
}
};
- public static TankFireAnimation get(float volume, float offset, float x0, float y0, float x1, float y1)
+ public static TankFireAnimation get(float volume, float x0, float y0, float x1, float y1, float halfWidth)
{
TankFireAnimation a = fireAnimationPool.obtain();
- a.set(volume, offset, x0, y0, x1, y1);
+ a.set(volume, x0, y0, x1, y1, halfWidth);
return a;
}
@@ -65,7 +65,7 @@ public class TankFireAnimation implements Disposable, Animation, Pool.Poolable
this.fireRegion = new TextureRegion(FireAnimation.tankFire.frames[0]);
}
- private void set(float volume, float offset, float x0, float y0, float x1, float y1)
+ private void set(float volume, float x0, float y0, float x1, float y1, float halfWidth)
{
this.fired = false;
this.hit = false;
@@ -77,8 +77,8 @@ public class TankFireAnimation implements Disposable, Animation, Pool.Poolable
y1 += ((SHOT_SCATTERING * FireAnimation.random.nextFloat()) - (SHOT_SCATTERING / 2f));
double r = Math.atan2((y0 - y1), (x0 - x1));
- float xadj = (float) (Math.cos(r) * offset);
- float yadj = (float) (Math.sin(r) * offset);
+ float xadj = (float) (Math.cos(r) * halfWidth);
+ float yadj = (float) (Math.sin(r) * halfWidth);
x0 -= xadj;
y0 -= yadj;