summaryrefslogtreecommitdiffstats
path: root/core/src
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2018-12-07 01:08:14 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2018-12-07 01:08:14 +0100
commit021abd4a0228c90d035e602feb32036fc3b4c111 (patch)
treec5d36d7bed3862af6e512c263ccf22c8eebc09f5 /core/src
parentdea17357ce5140efa52b7eec514a50bfc266b87d (diff)
downloadgdx-boardgame-021abd4a0228c90d035e602feb32036fc3b4c111.zip
gdx-boardgame-021abd4a0228c90d035e602feb32036fc3b4c111.tar.gz
ShellFireAnimation : Shoot -> Fire
Diffstat (limited to 'core/src')
-rw-r--r--core/src/ch/asynk/gdx/boardgame/Piece.java2
-rw-r--r--core/src/ch/asynk/gdx/boardgame/animations/ShellFireAnimation.java16
2 files changed, 9 insertions, 9 deletions
diff --git a/core/src/ch/asynk/gdx/boardgame/Piece.java b/core/src/ch/asynk/gdx/boardgame/Piece.java
index a2017b0..c9bf6fe 100644
--- a/core/src/ch/asynk/gdx/boardgame/Piece.java
+++ b/core/src/ch/asynk/gdx/boardgame/Piece.java
@@ -51,7 +51,7 @@ public class Piece extends Sprite implements Drawable, Positionable, Rotable, Sc
return (Orientation.fromR(getRotation()) == orientation);
}
- public void getShootingPoint(Vector2 v, Piece target)
+ public void getFireingPoint(Vector2 v, Piece target)
{
float x0 = getX();
float y0 = getY();
diff --git a/core/src/ch/asynk/gdx/boardgame/animations/ShellFireAnimation.java b/core/src/ch/asynk/gdx/boardgame/animations/ShellFireAnimation.java
index 6cc7227..1cb6f15 100644
--- a/core/src/ch/asynk/gdx/boardgame/animations/ShellFireAnimation.java
+++ b/core/src/ch/asynk/gdx/boardgame/animations/ShellFireAnimation.java
@@ -19,7 +19,7 @@ public class ShellFireAnimation extends TimedAnimation implements Pool.Poolable
private static class Config
{
public float maxFireDelay;
- public float maxShootScattering;
+ public float maxFireScattering;
public float shellSpeed;
public float smokeDuration;
public float explosionDuration;
@@ -27,13 +27,13 @@ public class ShellFireAnimation extends TimedAnimation implements Pool.Poolable
public FramedSprite explosionSprites;
public Sound shellFireSnd;
public Sound explosionSnd;
- public Config(float maxFireDelay, float maxShootScattering, float shellSpeed,
+ public Config(float maxFireDelay, float maxFireScattering, float shellSpeed,
float smokeDuration, float explosionDuration,
FramedSprite shellSprites, FramedSprite explosionSprites,
Sound shellFireSnd, Sound explosionSnd)
{
this.maxFireDelay = maxFireDelay;
- this.maxShootScattering = maxShootScattering;
+ this.maxFireScattering = maxFireScattering;
this.shellSpeed = shellSpeed;
this.smokeDuration = smokeDuration;
this.explosionDuration = explosionDuration;
@@ -48,7 +48,7 @@ public class ShellFireAnimation extends TimedAnimation implements Pool.Poolable
public static void register(final String name,
float maxFireDelay,
- float maxShootScattering,
+ float maxFireScattering,
float shellSpeed,
float smokeDuration,
float explosionDuration,
@@ -58,7 +58,7 @@ public class ShellFireAnimation extends TimedAnimation implements Pool.Poolable
final Sound explosionSnd
)
{
- Config cfg = new Config(maxFireDelay, maxShootScattering, shellSpeed, smokeDuration, explosionDuration,
+ Config cfg = new Config(maxFireDelay, maxFireScattering, shellSpeed, smokeDuration, explosionDuration,
new FramedSprite(shellTexture, shellR, shellC),
new FramedSprite(explosionTexture, explosionR, explosionC),
shellFireSnd, explosionSnd
@@ -88,7 +88,7 @@ public class ShellFireAnimation extends TimedAnimation implements Pool.Poolable
public static Vector2 tv = new Vector2();
public static ShellFireAnimation obtain(final String configName, Piece shooter, Piece target)
{
- shooter.getShootingPoint(sv, target);
+ shooter.getFireingPoint(sv, target);
target.getImpactPoint(tv);
return obtain(configName, sv.x, sv.y, tv.x, tv.y);
}
@@ -144,8 +144,8 @@ public class ShellFireAnimation extends TimedAnimation implements Pool.Poolable
private void compute(float x0, float y0, float x1, float y1)
{
// scattering
- x1 = (x1 + (random.nextFloat() * cfg.maxShootScattering) - (cfg.maxShootScattering / 2f));
- y1 = (y1 + (random.nextFloat() * cfg.maxShootScattering) - (cfg.maxShootScattering / 2f));
+ x1 = (x1 + (random.nextFloat() * cfg.maxFireScattering) - (cfg.maxFireScattering / 2f));
+ y1 = (y1 + (random.nextFloat() * cfg.maxFireScattering) - (cfg.maxFireScattering / 2f));
// geometry
float dx = (x1 - x0);