From 07c87519c22ee6cca6c89f5063d28ab801044d49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 19 Apr 2016 11:25:43 +0200 Subject: Board: add setBlock(float) --- core/src/ch/asynk/rustanddust/engine/Board.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/src/ch/asynk/rustanddust/engine/Board.java b/core/src/ch/asynk/rustanddust/engine/Board.java index 1e23bb1..36a4926 100644 --- a/core/src/ch/asynk/rustanddust/engine/Board.java +++ b/core/src/ch/asynk/rustanddust/engine/Board.java @@ -24,6 +24,7 @@ import ch.asynk.rustanddust.engine.gfx.animations.MoveToAnimation.MoveToAnimatio public abstract class Board implements Disposable, Animation { + private float block; private int cols; private int rows; private final Tile neighbours[] = new Tile[6]; @@ -70,6 +71,7 @@ public abstract class Board implements Disposable, Animation protected Board(int cols, int rows) { + this.block = 0f; // add a frame of OFFMAP Tiles this.cols = (cols + 2); this.rows = (rows + 2); @@ -251,8 +253,18 @@ public abstract class Board implements Disposable, Animation Gdx.app.debug("Board", " tiles:" + tileCount + " pawns:" + pawnCount + " animations:" + animationCount); } + public void setBlock(float dt) + { + block = dt; + } + public boolean animate(float delta) { + if (block > 0f) { + block -= delta; + if (block > 0f) + return true; + } boolean over = (animations.size() > 0); Iterator iter = animations.iterator(); while (iter.hasNext()) { -- cgit v1.1-2-g2b99