From 1f39ed07f64bc37d4869bca07c33b899f307d966 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 29 Dec 2015 10:25:53 +0100 Subject: HeadedPawn: aimAt does a body rotation if no turret --- core/src/ch/asynk/rustanddust/engine/HeadedPawn.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/core/src/ch/asynk/rustanddust/engine/HeadedPawn.java b/core/src/ch/asynk/rustanddust/engine/HeadedPawn.java index faecd6d..a1234a7 100644 --- a/core/src/ch/asynk/rustanddust/engine/HeadedPawn.java +++ b/core/src/ch/asynk/rustanddust/engine/HeadedPawn.java @@ -89,10 +89,13 @@ public abstract class HeadedPawn extends Pawn @Override public void aimAt(float r) { - if (canAim()) { - turretR = r; - turret.setRotation(body.getRotation() + turretR); + if (canAim()) + turret.setRotation(body.getRotation() + r); + else { + float d = (r - turretR); + body.setRotation(body.getRotation() + d); } + turretR = r; } @Override -- cgit v1.1-2-g2b99