summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-10-29 09:36:37 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-10-29 09:36:37 +0100
commit1e0bef46c8e1ed02c35adfa975a0abf9dce13896 (patch)
tree03f5b0e68939437ab47f789e7cd8e9096212fdea
parent47fa20f6ae602fcd3abfe571b11c0c96c49896cf (diff)
downloadRustAndDust-1e0bef46c8e1ed02c35adfa975a0abf9dce13896.zip
RustAndDust-1e0bef46c8e1ed02c35adfa975a0abf9dce13896.tar.gz
Pawn,Board: give current AnimationSequence size when asking Pawn for it
-rw-r--r--core/src/ch/asynk/tankontank/engine/Board.java6
-rw-r--r--core/src/ch/asynk/tankontank/engine/Pawn.java12
2 files changed, 9 insertions, 9 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Board.java b/core/src/ch/asynk/tankontank/engine/Board.java
index b1eb382..8fbc548 100644
--- a/core/src/ch/asynk/tankontank/engine/Board.java
+++ b/core/src/ch/asynk/tankontank/engine/Board.java
@@ -457,7 +457,7 @@ public abstract class Board implements Disposable
getCoordinatePath(pawn, 0, finalPath, o);
removePawn(pawn);
- AnimationSequence seq = pawn.getMoveAnimation(finalPath);
+ AnimationSequence seq = pawn.getMoveAnimation(finalPath, 2);
seq.addAnimation(RunnableAnimation.get(pawn, new Runnable() {
@Override
public void run() {
@@ -476,7 +476,7 @@ public abstract class Board implements Disposable
Vector3 p = pawn.getPosition();
Vector3 v = vector3Pool.obtain();
v.set(p.x, p.y, o.r());
- AnimationSequence seq = pawn.getRotateAnimation(v);
+ AnimationSequence seq = pawn.getRotateAnimation(v, 1);
seq.addAnimation(whenDone);
addAnimation(seq);
vector3Pool.free(v);
@@ -487,7 +487,7 @@ public abstract class Board implements Disposable
{
removePawn(pawn);
- AnimationSequence seq = pawn.getRevertLastMoveAnimation();
+ AnimationSequence seq = pawn.getRevertLastMoveAnimation(2);
seq.addAnimation(RunnableAnimation.get(pawn, new Runnable() {
@Override
public void run() {
diff --git a/core/src/ch/asynk/tankontank/engine/Pawn.java b/core/src/ch/asynk/tankontank/engine/Pawn.java
index 4439b31..42a4083 100644
--- a/core/src/ch/asynk/tankontank/engine/Pawn.java
+++ b/core/src/ch/asynk/tankontank/engine/Pawn.java
@@ -238,28 +238,28 @@ public abstract class Pawn implements Moveable, Disposable
return hasOverlayEnabled();
}
- public AnimationSequence getRotateAnimation(Vector3 v)
+ public AnimationSequence getRotateAnimation(Vector3 v, int size)
{
prevPosition.set(position);
- AnimationSequence seq = AnimationSequence.get(2);
+ AnimationSequence seq = AnimationSequence.get(1 + size);
seq.addAnimation(MoveToAnimation.get(this, v, MOVE_TIME));
return seq;
}
- public AnimationSequence getMoveAnimation(ArrayList<Vector3> path)
+ public AnimationSequence getMoveAnimation(ArrayList<Vector3> path, int size)
{
prevPosition.set(position);
- AnimationSequence seq = AnimationSequence.get(path.size() + 2);
+ AnimationSequence seq = AnimationSequence.get(path.size() + size);
for (Vector3 v : path)
seq.addAnimation(MoveToAnimation.get(this, v, MOVE_TIME));
return seq;
}
- public AnimationSequence getRevertLastMoveAnimation()
+ public AnimationSequence getRevertLastMoveAnimation(int size)
{
- AnimationSequence seq = AnimationSequence.get(4);
+ AnimationSequence seq = AnimationSequence.get(2 + size);
seq.addAnimation(MoveToAnimation.get(this, prevPosition, MOVE_TIME));
seq.addAnimation(RunnableAnimation.get(this, new Runnable() {
@Override