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/Board.java9
-rw-r--r--core/src/ch/asynk/tankontank/engine/Tile.java8
-rw-r--r--core/src/ch/asynk/tankontank/engine/gfx/StackedImages.java5
3 files changed, 22 insertions, 0 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Board.java b/core/src/ch/asynk/tankontank/engine/Board.java
index e5bd302..17632ff 100644
--- a/core/src/ch/asynk/tankontank/engine/Board.java
+++ b/core/src/ch/asynk/tankontank/engine/Board.java
@@ -470,6 +470,15 @@ public abstract class Board implements Disposable
tilesToDraw.remove(tile);
}
+ public void enableOverlayOn(GridPoint2 coords, int i, boolean enable, Orientation o)
+ {
+ Tile tile = getTile(coords);
+ if(tile.enableOverlay(i, enable, o.r()))
+ tilesToDraw.add(tile);
+ else
+ tilesToDraw.remove(tile);
+ }
+
public Pawn getTopPawnAt(GridPoint2 coords)
{
return getTile(coords).getTopPawn();
diff --git a/core/src/ch/asynk/tankontank/engine/Tile.java b/core/src/ch/asynk/tankontank/engine/Tile.java
index b47548c..fdcc61e 100644
--- a/core/src/ch/asynk/tankontank/engine/Tile.java
+++ b/core/src/ch/asynk/tankontank/engine/Tile.java
@@ -131,6 +131,14 @@ public abstract class Tile implements Drawable, Disposable
return mustBeDrawn();
}
+ public boolean enableOverlay(int i, boolean enable, float r)
+ {
+ overlays.enable(i, enable);
+ overlays.rotate(i, r);
+ if (enable) return true;
+ return mustBeDrawn();
+ }
+
@Override
public void draw(Batch batch)
{
diff --git a/core/src/ch/asynk/tankontank/engine/gfx/StackedImages.java b/core/src/ch/asynk/tankontank/engine/gfx/StackedImages.java
index 1397c9d..a659c68 100644
--- a/core/src/ch/asynk/tankontank/engine/gfx/StackedImages.java
+++ b/core/src/ch/asynk/tankontank/engine/gfx/StackedImages.java
@@ -47,6 +47,11 @@ public class StackedImages implements Drawable, Disposable
return false;
}
+ public void rotate(int i, float r)
+ {
+ sprites.get(i).setRotation(r);
+ }
+
public void setRotation(float r)
{
for (int i = 0, n = sprites.size; i < n; i++)