diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-05 23:35:34 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-05 23:35:34 +0100 |
commit | 4eda8cc42f83d3c8c55fd093feb6dd4bd4b7e951 (patch) | |
tree | d446cf3ded93e747bb49f2524c11a45fe2f26082 /core/src/ch/asynk/tankontank | |
parent | cf3e780fd2aa109651e29239bf8a22aa61fa460e (diff) | |
download | RustAndDust-4eda8cc42f83d3c8c55fd093feb6dd4bd4b7e951.zip RustAndDust-4eda8cc42f83d3c8c55fd093feb6dd4bd4b7e951.tar.gz |
Pawn: add centerOn(flaot, float)
Diffstat (limited to 'core/src/ch/asynk/tankontank')
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/Pawn.java | 5 |
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 049ff3e..b81f8c2 100644 --- a/core/src/ch/asynk/tankontank/engine/Pawn.java +++ b/core/src/ch/asynk/tankontank/engine/Pawn.java @@ -273,6 +273,11 @@ public abstract class Pawn implements Moveable, Disposable return Orientation.fromRotation(getRotation()); } + public void centerOn(float x, float y) + { + setPosition((x - (getWidth() / 2f)), (y - (getHeight() / 2f))); + } + @Override public void setPosition(float x, float y) { |