summaryrefslogtreecommitdiffstats
path: root/core/src
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-10-06 14:15:01 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2014-10-06 14:15:01 +0200
commitbd9947b9147e0aa3a9d2af7220a759e53fa006bc (patch)
tree4fe6a279375f8cabf9b89c830a6f74da94113aa0 /core/src
parent311d997ef12300c63cf48047cb647594af64a39b (diff)
downloadRustAndDust-bd9947b9147e0aa3a9d2af7220a759e53fa006bc.zip
RustAndDust-bd9947b9147e0aa3a9d2af7220a759e53fa006bc.tar.gz
Board: add rotatePawn(Pawn, Orientation, RunnableAnnimation)
Diffstat (limited to 'core/src')
-rw-r--r--core/src/ch/asynk/tankontank/engine/Board.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Board.java b/core/src/ch/asynk/tankontank/engine/Board.java
index ee0c76e..5b5ecf8 100644
--- a/core/src/ch/asynk/tankontank/engine/Board.java
+++ b/core/src/ch/asynk/tankontank/engine/Board.java
@@ -452,6 +452,17 @@ public abstract class Board implements Disposable
addPawnAnimation(pawn, seq);
}
+ public void rotatePawn(final Pawn pawn, Orientation o, RunnableAnimation whenDone)
+ {
+ Vector3 p = pawn.getPosition();
+ Vector3 v = vector3Pool.obtain();
+ v.set(p.x, p.y, o.r());
+ AnimationSequence seq = pawn.getRotateAnimation(v);
+ seq.addAnimation(whenDone);
+ addPawnAnimation(pawn, seq);
+ vector3Pool.free(v);
+ }
+
private GridPoint2 getHexAt(Vector2 v)
{
if (v == null) return null;