summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-12-17 16:48:39 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-12-17 16:48:39 +0100
commit8aa3799b3865eb6436ba2053687d5b8b22414ba2 (patch)
tree236e60f16313fe844c0e66ab00936c7cea87b2d8 /core
parent2c4d6504abbd51a177aa173dde6ebd37fe765754 (diff)
downloadRustAndDust-8aa3799b3865eb6436ba2053687d5b8b22414ba2.zip
RustAndDust-8aa3799b3865eb6436ba2053687d5b8b22414ba2.tar.gz
Pawn: add translate(float, float)
Diffstat (limited to 'core')
-rw-r--r--core/src/ch/asynk/tankontank/engine/Pawn.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Pawn.java b/core/src/ch/asynk/tankontank/engine/Pawn.java
index 4834b45..0808f86 100644
--- a/core/src/ch/asynk/tankontank/engine/Pawn.java
+++ b/core/src/ch/asynk/tankontank/engine/Pawn.java
@@ -301,6 +301,11 @@ public abstract class Pawn implements Moveable, Disposable
return Orientation.fromRotation(getRotation());
}
+ public void translate(float dx, float dy)
+ {
+ setPosition((getX() + dx), (getY() + dy));
+ }
+
public void centerOn(float x, float y)
{
setPosition((x - (getWidth() / 2f)), (y - (getHeight() / 2f)));