diff options
| author | Jérémy Zurcher <jeremy@asynk.ch> | 2016-04-19 11:25:43 +0200 | 
|---|---|---|
| committer | Jérémy Zurcher <jeremy@asynk.ch> | 2016-04-19 11:25:43 +0200 | 
| commit | 07c87519c22ee6cca6c89f5063d28ab801044d49 (patch) | |
| tree | 3ce7f17733f9853f83190b10b9bb5fbfe0abf0c5 /core/src/ch/asynk | |
| parent | 67fe442489b9c9a14abde8201441c091ff69e976 (diff) | |
| download | RustAndDust-07c87519c22ee6cca6c89f5063d28ab801044d49.zip RustAndDust-07c87519c22ee6cca6c89f5063d28ab801044d49.tar.gz | |
Board: add setBlock(float)
Diffstat (limited to 'core/src/ch/asynk')
| -rw-r--r-- | core/src/ch/asynk/rustanddust/engine/Board.java | 12 | 
1 files changed, 12 insertions, 0 deletions
| 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<Animation> iter = animations.iterator();          while (iter.hasNext()) { | 
