summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2020-06-01 22:24:41 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2020-06-01 22:24:41 +0200
commit842d1182857f7dd9ffc7f8bf6252100ae1199c06 (patch)
tree60b8922ccc405e1ace532f918153feb4baaceff0 /test
parent1a9d984f25b07a5c45484825274c177ea39bc1c3 (diff)
downloadgdx-boardgame-842d1182857f7dd9ffc7f8bf6252100ae1199c06.zip
gdx-boardgame-842d1182857f7dd9ffc7f8bf6252100ae1199c06.tar.gz
Tile : float x,y->cx,cy, add int x,y
Diffstat (limited to 'test')
-rw-r--r--test/src/ch/asynk/gdx/boardgame/test/AnimationsScreen.java38
-rw-r--r--test/src/ch/asynk/gdx/boardgame/test/BoardScreen.java2
2 files changed, 18 insertions, 22 deletions
diff --git a/test/src/ch/asynk/gdx/boardgame/test/AnimationsScreen.java b/test/src/ch/asynk/gdx/boardgame/test/AnimationsScreen.java
index b964668..af6a856 100644
--- a/test/src/ch/asynk/gdx/boardgame/test/AnimationsScreen.java
+++ b/test/src/ch/asynk/gdx/boardgame/test/AnimationsScreen.java
@@ -127,33 +127,29 @@ public class AnimationsScreen extends AbstractScreen
private Path buildPath(final GdxBoardTest app)
{
Tile.defaultOverlay = app.assets.getAtlas(app.assets.HEX_OVERLAYS);
- Vector2 v = new Vector2();
Path path = Path.obtain();
path.ensureCapacity(10);
- board.centerOf(7, 4, v);
- path.add(new Tile(v.x, v.y));
- board.centerOf(6, 4, v);
- path.add(new Tile(v.x, v.y));
- board.centerOf(5, 3, v);
- path.add(new Tile(v.x, v.y));
- board.centerOf(5, 2, v);
- path.add(new Tile(v.x, v.y));
- board.centerOf(6, 2, v);
- path.add(new Tile(v.x, v.y));
- board.centerOf(7, 2, v);
- path.add(new Tile(v.x, v.y));
- board.centerOf(8, 3, v);
- path.add(new Tile(v.x, v.y));
- board.centerOf(9, 4, v);
- path.add(new Tile(v.x, v.y));
- board.centerOf(8, 4, v);
- path.add(new Tile(v.x, v.y));
- board.centerOf(7, 4, v);
- path.add(new Tile(v.x, v.y));
+ addTile(path, 7, 4);
+ addTile(path, 6, 4);
+ addTile(path, 5, 3);
+ addTile(path, 5, 2);
+ addTile(path, 6, 2);
+ addTile(path, 7, 2);
+ addTile(path, 8, 3);
+ addTile(path, 9, 4);
+ addTile(path, 8, 4);
+ addTile(path, 7, 4);
path.setFinalOrientation(Orientation.NE);
return path;
}
+ private void addTile(Path path, int x, int y)
+ {
+ final Vector2 v = new Vector2();
+ board.centerOf(x, y, v);
+ path.add(new Tile(x, y, v.x, v.y));
+ }
+
private AnimationBatch getFireAnimationBatch()
{
AnimationBatch batch = AnimationBatch.obtain(3);
diff --git a/test/src/ch/asynk/gdx/boardgame/test/BoardScreen.java b/test/src/ch/asynk/gdx/boardgame/test/BoardScreen.java
index 8388959..d20e52a 100644
--- a/test/src/ch/asynk/gdx/boardgame/test/BoardScreen.java
+++ b/test/src/ch/asynk/gdx/boardgame/test/BoardScreen.java
@@ -150,7 +150,7 @@ public class BoardScreen extends AbstractScreen
{
final Vector2 v = new Vector2();
board.centerOf(x, y, v);
- return new Tile(v.x, v.y);
+ return new Tile(x, y, v.x, v.y);
}
public void setHEX_V()