summaryrefslogtreecommitdiffstats
path: root/test/src/ch/asynk
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2018-09-20 16:43:14 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2018-09-20 16:43:14 +0200
commita3cc8e9523d1ca22588908bdd5b13d9a8fa58a07 (patch)
treee71f91c0a73a2e95a47e27ab9756b3bbdbf1ccb1 /test/src/ch/asynk
parent7c2bbdb9ae7f10a87c6a63d6435712b8751eb6fd (diff)
downloadgdx-boardgame-a3cc8e9523d1ca22588908bdd5b13d9a8fa58a07.zip
gdx-boardgame-a3cc8e9523d1ca22588908bdd5b13d9a8fa58a07.tar.gz
add sherman unit to tests
Diffstat (limited to 'test/src/ch/asynk')
-rw-r--r--test/src/ch/asynk/gdx/board/test/Assets.java3
-rw-r--r--test/src/ch/asynk/gdx/board/test/GameBoard.java4
2 files changed, 7 insertions, 0 deletions
diff --git a/test/src/ch/asynk/gdx/board/test/Assets.java b/test/src/ch/asynk/gdx/board/test/Assets.java
index 19e16df..c3d76ab 100644
--- a/test/src/ch/asynk/gdx/board/test/Assets.java
+++ b/test/src/ch/asynk/gdx/board/test/Assets.java
@@ -22,6 +22,7 @@ public class Assets extends ch.asynk.gdx.tabletop.Assets
public static final String FONT_20 = "size20.ttf";
public static final String FONT_25 = "size25.ttf";
public static final String PATCH = "ui-patch.png";
+ public static final String SHERMAN = "sherman.png";
private final FreeTypeFontLoaderParameter params20;
private final FreeTypeFontLoaderParameter params25;
@@ -64,6 +65,7 @@ public class Assets extends ch.asynk.gdx.tabletop.Assets
load(TRI, Texture.class);
load(CORNER, Texture.class);
load(PATCH, Texture.class);
+ load(SHERMAN, Texture.class);
load(FONT_20, BitmapFont.class, params20);
load(FONT_25, BitmapFont.class, params25);
}
@@ -75,6 +77,7 @@ public class Assets extends ch.asynk.gdx.tabletop.Assets
unload(TRI);
unload(CORNER);
unload(PATCH);
+ unload(SHERMAN);
unload(FONT_20);
unload(FONT_25);
}
diff --git a/test/src/ch/asynk/gdx/board/test/GameBoard.java b/test/src/ch/asynk/gdx/board/test/GameBoard.java
index e065745..801e947 100644
--- a/test/src/ch/asynk/gdx/board/test/GameBoard.java
+++ b/test/src/ch/asynk/gdx/board/test/GameBoard.java
@@ -13,6 +13,7 @@ public class GameBoard implements Disposable, Touchable
{
private final Assets assets;
private Texture map;
+ private Texture sherman;
private Board board;
private int dx;
@@ -27,6 +28,7 @@ public class GameBoard implements Disposable, Touchable
{
this.assets = assets;
this.v = new Vector2();
+ this.sherman = assets.getTexture(assets.SHERMAN);
setState(GameScreen.State.UI);
}
@@ -64,6 +66,7 @@ public class GameBoard implements Disposable, Touchable
setTRI_V();
break;
}
+ board.centerOf(0, 0, v);
}
private void setHEX_V()
@@ -134,5 +137,6 @@ public class GameBoard implements Disposable, Touchable
public void draw(Batch batch)
{
batch.draw(map, dx, dy, map.getWidth()/2, map.getHeight()/2, map.getWidth(), map.getHeight(), 1, 1, r, 0, 0, map.getWidth(), map.getHeight(), false, false);
+ batch.draw(sherman, v.x - (sherman.getWidth() / 2), v.y - (sherman.getHeight() / 2));
}
}