diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/Pawn.java | 11 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/gfx/Drawable.java | 1 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/gfx/Moveable.java | 12 |
3 files changed, 21 insertions, 3 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Pawn.java b/core/src/ch/asynk/tankontank/engine/Pawn.java index 83cd642..d646915 100644 --- a/core/src/ch/asynk/tankontank/engine/Pawn.java +++ b/core/src/ch/asynk/tankontank/engine/Pawn.java @@ -14,13 +14,13 @@ import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.math.Vector3; import ch.asynk.tankontank.engine.gfx.Image; -import ch.asynk.tankontank.engine.gfx.Drawable; +import ch.asynk.tankontank.engine.gfx.Moveable; import ch.asynk.tankontank.engine.gfx.StackedImages; import ch.asynk.tankontank.engine.gfx.animations.MoveToAnimation; import ch.asynk.tankontank.engine.gfx.animations.RunnableAnimation; import ch.asynk.tankontank.engine.gfx.animations.AnimationSequence; -public abstract class Pawn implements Drawable, Disposable +public abstract class Pawn implements Moveable, Disposable { public class Attack { @@ -125,26 +125,31 @@ public abstract class Pawn implements Drawable, Disposable return pos; } + @Override public float getX() { return image.getX(); } + @Override public float getY() { return image.getY(); } + @Override public float getWidth() { return image.getWidth(); } + @Override public float getHeight() { return image.getHeight(); } + @Override public float getRotation() { return image.getRotation(); @@ -155,6 +160,7 @@ public abstract class Pawn implements Drawable, Disposable return Orientation.fromRotation(getRotation()); } + @Override public void setPosition(float x, float y) { position.set(x, y, 0f); @@ -171,6 +177,7 @@ public abstract class Pawn implements Drawable, Disposable overlays.setRotation(z); } + @Override public void setPosition(float x, float y, float z) { setPosition(x, y); diff --git a/core/src/ch/asynk/tankontank/engine/gfx/Drawable.java b/core/src/ch/asynk/tankontank/engine/gfx/Drawable.java index 0338727..433a019 100644 --- a/core/src/ch/asynk/tankontank/engine/gfx/Drawable.java +++ b/core/src/ch/asynk/tankontank/engine/gfx/Drawable.java @@ -6,6 +6,5 @@ import com.badlogic.gdx.graphics.glutils.ShapeRenderer; public interface Drawable { public void draw(Batch batch); - public void drawDebug(ShapeRenderer debugShapes); } diff --git a/core/src/ch/asynk/tankontank/engine/gfx/Moveable.java b/core/src/ch/asynk/tankontank/engine/gfx/Moveable.java new file mode 100644 index 0000000..238305e --- /dev/null +++ b/core/src/ch/asynk/tankontank/engine/gfx/Moveable.java @@ -0,0 +1,12 @@ +package ch.asynk.tankontank.engine.gfx; + +public interface Moveable extends Drawable +{ + public float getX(); + public float getY(); + public float getWidth(); + public float getHeight(); + public float getRotation(); + public void setPosition(float x, float y); + public void setPosition(float x, float y, float r); +} |