summaryrefslogtreecommitdiffstats
path: root/core/src/ch
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-09-25 11:19:34 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2014-09-25 11:19:34 +0200
commitc6756d41ed2861bfd802df097401bdd01e39bf19 (patch)
tree43f5dfdaacbb1621c256280f04223df3a4a9c779 /core/src/ch
parent7a1a3025b664c861016e8178331ce246aed08e8a (diff)
downloadRustAndDust-c6756d41ed2861bfd802df097401bdd01e39bf19.zip
RustAndDust-c6756d41ed2861bfd802df097401bdd01e39bf19.tar.gz
HeadePawn: add protected Board.Orientation orientation
Diffstat (limited to 'core/src/ch')
-rw-r--r--core/src/ch/asynk/tankontank/engine/HeadedPawn.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/HeadedPawn.java b/core/src/ch/asynk/tankontank/engine/HeadedPawn.java
index 36eb2a2..427d61f 100644
--- a/core/src/ch/asynk/tankontank/engine/HeadedPawn.java
+++ b/core/src/ch/asynk/tankontank/engine/HeadedPawn.java
@@ -12,11 +12,13 @@ import com.badlogic.gdx.math.Vector3;
public abstract class HeadedPawn extends Pawn
{
private Image head;
+ protected Board.Orientation orientation;
public HeadedPawn(TextureRegion region, TextureRegion head, TextureAtlas atlas)
{
super(region, atlas);
this.head = new Image(head);
+ this.orientation = Board.Orientation.KEEP;
}
@Override
@@ -29,7 +31,7 @@ public abstract class HeadedPawn extends Pawn
@Override
public float getRotation()
{
- return head.getRotation();
+ return orientation.r();
}
@Override
@@ -47,6 +49,7 @@ public abstract class HeadedPawn extends Pawn
float cy = y + (getHeight() / 2f) - (head.getHeight() / 2f);
head.setPosition(cx, cy);
head.setRotation(z);
+ this.orientation = Board.Orientation.fromRotation(z);
}
@Override