From 9837bd4294a4d53e7fe85557a0921cc9cb90cdd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Thu, 15 Nov 2018 14:33:54 +0100 Subject: =?UTF-8?q?TimedAnimation=20:=20update(=E2=80=A6)=20->=20update(fl?= =?UTF-8?q?oat=20delta),=20percent=20and=20elapsed=20are=20protected?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/ch/asynk/gdx/boardgame/animations/BounceAnimation.java | 2 +- core/src/ch/asynk/gdx/boardgame/animations/DelayAnimation.java | 2 +- core/src/ch/asynk/gdx/boardgame/animations/TimedAnimation.java | 10 +++++----- 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; } } -- cgit v1.1-2-g2b99