summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/ch/asynk/tankontank')
-rw-r--r--core/src/ch/asynk/tankontank/engine/HeadedPawn.java20
1 files changed, 19 insertions, 1 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/HeadedPawn.java b/core/src/ch/asynk/tankontank/engine/HeadedPawn.java
index 4f3a350..6ed498e 100644
--- a/core/src/ch/asynk/tankontank/engine/HeadedPawn.java
+++ b/core/src/ch/asynk/tankontank/engine/HeadedPawn.java
@@ -35,17 +35,35 @@ public abstract class HeadedPawn extends Pawn
}
@Override
- public void setPosition(float x, float y, float z)
+ public Orientation getOrientation()
+ {
+ return orientation;
+ }
+
+ @Override
+ public void setPosition(float x, float y)
{
super.setPosition(x, y);
float cx = x + (getWidth() / 2f);
float cy = y + (getHeight() / 2f);
head.centerOn(cx, cy);
+ }
+
+ @Override
+ public void setRotation(float z)
+ {
head.setRotation(z);
this.orientation = Orientation.fromRotation(z);
}
@Override
+ public void setPosition(float x, float y, float z)
+ {
+ setPosition(x, y);
+ setRotation(z);
+ }
+
+ @Override
public void draw(Batch batch)
{
head.draw(batch);