diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2018-09-20 16:43:14 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2018-09-20 16:43:14 +0200 |
commit | a3cc8e9523d1ca22588908bdd5b13d9a8fa58a07 (patch) | |
tree | e71f91c0a73a2e95a47e27ab9756b3bbdbf1ccb1 | |
parent | 7c2bbdb9ae7f10a87c6a63d6435712b8751eb6fd (diff) | |
download | gdx-boardgame-a3cc8e9523d1ca22588908bdd5b13d9a8fa58a07.zip gdx-boardgame-a3cc8e9523d1ca22588908bdd5b13d9a8fa58a07.tar.gz |
add sherman unit to tests
-rw-r--r-- | assets/data/sherman.png | bin | 0 -> 23223 bytes | |||
-rw-r--r-- | test/src/ch/asynk/gdx/board/test/Assets.java | 3 | ||||
-rw-r--r-- | test/src/ch/asynk/gdx/board/test/GameBoard.java | 4 |
3 files changed, 7 insertions, 0 deletions
diff --git a/assets/data/sherman.png b/assets/data/sherman.png Binary files differnew file mode 100644 index 0000000..bcfab18 --- /dev/null +++ b/assets/data/sherman.png 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)); } } |