summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r--core/src/ch/asynk/tankontank/engine/Tile.java9
-rw-r--r--core/src/ch/asynk/tankontank/engine/gfx/BasicDrawable.java2
-rw-r--r--core/src/ch/asynk/tankontank/engine/gfx/Drawable.java2
-rw-r--r--core/src/ch/asynk/tankontank/engine/gfx/StackedImages.java8
4 files changed, 19 insertions, 2 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Tile.java b/core/src/ch/asynk/tankontank/engine/Tile.java
index 96c6d60..6f40f8c 100644
--- a/core/src/ch/asynk/tankontank/engine/Tile.java
+++ b/core/src/ch/asynk/tankontank/engine/Tile.java
@@ -70,11 +70,19 @@ public abstract class Tile implements BasicDrawable
return null;
}
+ @Override
+ public void translate(float x, float y)
+ {
+ overlays.translate(x, y);
+ }
+
+ @Override
public void setPosition(float x, float y, float z)
{
overlays.setPosition(x, y, z);
}
+ @Override
public void draw(Batch batch, float parentAlpha)
{
overlays.draw(batch, parentAlpha);
@@ -83,6 +91,7 @@ public abstract class Tile implements BasicDrawable
pawn.draw(batch, parentAlpha);
}
+ @Override
public void drawDebug(ShapeRenderer debugShapes)
{
overlays.drawDebug(debugShapes);
diff --git a/core/src/ch/asynk/tankontank/engine/gfx/BasicDrawable.java b/core/src/ch/asynk/tankontank/engine/gfx/BasicDrawable.java
index f143505..776ac22 100644
--- a/core/src/ch/asynk/tankontank/engine/gfx/BasicDrawable.java
+++ b/core/src/ch/asynk/tankontank/engine/gfx/BasicDrawable.java
@@ -5,6 +5,8 @@ import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
public interface BasicDrawable
{
+ public void translate(float dx, float dy);
+
public void setPosition(float x, float y, float r);
public void draw(Batch batch, float parentAlpha);
diff --git a/core/src/ch/asynk/tankontank/engine/gfx/Drawable.java b/core/src/ch/asynk/tankontank/engine/gfx/Drawable.java
index e5f1858..ca749be 100644
--- a/core/src/ch/asynk/tankontank/engine/gfx/Drawable.java
+++ b/core/src/ch/asynk/tankontank/engine/gfx/Drawable.java
@@ -16,7 +16,5 @@ public interface Drawable extends BasicDrawable
public void setRotation(float r);
- public void translate(float dx, float dy);
-
public void setPosition(float x, float y);
}
diff --git a/core/src/ch/asynk/tankontank/engine/gfx/StackedImages.java b/core/src/ch/asynk/tankontank/engine/gfx/StackedImages.java
index 8e450ad..5eb5e55 100644
--- a/core/src/ch/asynk/tankontank/engine/gfx/StackedImages.java
+++ b/core/src/ch/asynk/tankontank/engine/gfx/StackedImages.java
@@ -30,6 +30,14 @@ public class StackedImages implements BasicDrawable
}
@Override
+ public void translate(float x, float y)
+ {
+ for (int i = 0; i < sprites.size; i++) {
+ sprites.get(i).translate(x, y);
+ }
+ }
+
+ @Override
public void setPosition(float x, float y, float r)
{
for (int i = 0; i < sprites.size; i++) {