diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2015-12-16 16:05:24 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2015-12-16 16:05:24 +0100 |
commit | d6d988ff7020cb04cf8e6b271dace10104583e22 (patch) | |
tree | 6969faf9a90be4074ff756492502aefd95d25e05 /core/src/ch/asynk | |
parent | 8d91f62423e6e7b7914666fd4d43b41e6ff098bd (diff) | |
download | RustAndDust-d6d988ff7020cb04cf8e6b271dace10104583e22.zip RustAndDust-d6d988ff7020cb04cf8e6b271dace10104583e22.tar.gz |
HeadedPawn: draw overlays over the head
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r-- | core/src/ch/asynk/rustanddust/engine/HeadedPawn.java | 12 | ||||
-rw-r--r-- | core/src/ch/asynk/rustanddust/engine/Pawn.java | 4 |
2 files changed, 10 insertions, 6 deletions
diff --git a/core/src/ch/asynk/rustanddust/engine/HeadedPawn.java b/core/src/ch/asynk/rustanddust/engine/HeadedPawn.java index c26610f..f60e38e 100644 --- a/core/src/ch/asynk/rustanddust/engine/HeadedPawn.java +++ b/core/src/ch/asynk/rustanddust/engine/HeadedPawn.java @@ -79,16 +79,20 @@ public abstract class HeadedPawn extends Pawn @Override public void draw(Batch batch) { - super.draw(batch); + sprite.draw(batch); head.draw(batch); + overlays.draw(batch); } @Override public void drawDebug(ShapeRenderer debugShapes) { - super.drawDebug(debugShapes); - float w = head.getWidth(); - float h = head.getHeight(); + float w = sprite.getWidth(); + float h = sprite.getHeight(); + debugShapes.rect(sprite.getX(), sprite.getY(), (w / 2f), (h / 2f), w, h, sprite.getScaleX(), sprite.getScaleY(), sprite.getRotation()); + w = head.getWidth(); + h = head.getHeight(); debugShapes.rect(head.getX(), head.getY(), (w / 2f), (h / 2f), w, h, head.getScaleX(), head.getScaleY(), head.getRotation()); + overlays.drawDebug(debugShapes); } } diff --git a/core/src/ch/asynk/rustanddust/engine/Pawn.java b/core/src/ch/asynk/rustanddust/engine/Pawn.java index fc20611..43de4f4 100644 --- a/core/src/ch/asynk/rustanddust/engine/Pawn.java +++ b/core/src/ch/asynk/rustanddust/engine/Pawn.java @@ -37,8 +37,8 @@ public abstract class Pawn implements Moveable, Disposable private Tile prevTile; protected Faction faction; protected String descr; - private Sprite sprite; - private StackedImages overlays; + protected Sprite sprite; + protected StackedImages overlays; protected Attack attack; protected Move move; |