summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2018-11-15 14:33:54 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2018-11-15 14:33:54 +0100
commit9837bd4294a4d53e7fe85557a0921cc9cb90cdd3 (patch)
treed6d47b409970bc16dc4a3488cdcf7051ecfb6e19
parent8d0a8db70967831191d051b090cea09c822e26cc (diff)
downloadgdx-boardgame-9837bd4294a4d53e7fe85557a0921cc9cb90cdd3.zip
gdx-boardgame-9837bd4294a4d53e7fe85557a0921cc9cb90cdd3.tar.gz
TimedAnimation : update(…) -> update(float delta), percent and elapsed are protected
-rw-r--r--core/src/ch/asynk/gdx/boardgame/animations/BounceAnimation.java2
-rw-r--r--core/src/ch/asynk/gdx/boardgame/animations/DelayAnimation.java2
-rw-r--r--core/src/ch/asynk/gdx/boardgame/animations/TimedAnimation.java10
3 files changed, 7 insertions, 7 deletions
diff --git a/core/src/ch/asynk/gdx/boardgame/animations/BounceAnimation.java b/core/src/ch/asynk/gdx/boardgame/animations/BounceAnimation.java
index cda604c..285447a 100644
--- a/core/src/ch/asynk/gdx/boardgame/animations/BounceAnimation.java
+++ b/core/src/ch/asynk/gdx/boardgame/animations/BounceAnimation.java
@@ -72,7 +72,7 @@ public class BounceAnimation extends TimedAnimation implements Pool.Poolable
}
}
- @Override protected void update(float elapsed, float percent)
+ @Override protected void update(float delta)
{
piece.setScale(this.startScale + this.bounceFactor * (float) Math.sin(percent * Math.PI));
if (rotationDegrees != 0f) {
diff --git a/core/src/ch/asynk/gdx/boardgame/animations/DelayAnimation.java b/core/src/ch/asynk/gdx/boardgame/animations/DelayAnimation.java
index 4ce6097..9b0b6d9 100644
--- a/core/src/ch/asynk/gdx/boardgame/animations/DelayAnimation.java
+++ b/core/src/ch/asynk/gdx/boardgame/animations/DelayAnimation.java
@@ -43,7 +43,7 @@ public class DelayAnimation extends TimedAnimation implements Pool.Poolable
@Override protected void begin() { }
@Override protected void end() { }
- @Override protected void update(float elapsed, float percent) { }
+ @Override protected void update(float delta) { }
@Override public void draw(Batch batch)
{
diff --git a/core/src/ch/asynk/gdx/boardgame/animations/TimedAnimation.java b/core/src/ch/asynk/gdx/boardgame/animations/TimedAnimation.java
index 25d11dc..04b84fd 100644
--- a/core/src/ch/asynk/gdx/boardgame/animations/TimedAnimation.java
+++ b/core/src/ch/asynk/gdx/boardgame/animations/TimedAnimation.java
@@ -3,12 +3,12 @@ package ch.asynk.gdx.boardgame.animations;
public abstract class TimedAnimation implements Animation
{
private float dp;
- private float percent;
- private float elapsed;
+ protected float percent;
+ protected float elapsed;
abstract protected void begin();
abstract protected void end();
- abstract protected void update(float elapsed, float percent);
+ abstract protected void update(float delta);
public void setDuration(float duration)
{
@@ -37,11 +37,11 @@ public abstract class TimedAnimation implements Animation
if (percent >= 1f) {
// percent = 1f;
- // update(percent);
+ // update(delta);
end();
return true;
} else {
- update(elapsed, percent);
+ update(delta);
return false;
}
}