summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-12-03 11:16:54 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-12-03 11:16:54 +0100
commit29f2a2470a3f4934de849871a68acb57f597b362 (patch)
tree346b4d2fa5b6a5099b6cf176ef2ca3a470a15395 /core
parentc7ff5337b3a0214084a7eb3d41dcad9a3a5a6d91 (diff)
downloadRustAndDust-29f2a2470a3f4934de849871a68acb57f597b362.zip
RustAndDust-29f2a2470a3f4934de849871a68acb57f597b362.tar.gz
add hex.png and use selectedTile
Diffstat (limited to 'core')
-rw-r--r--core/src/ch/asynk/tankontank/TankOnTank.java2
-rw-r--r--core/src/ch/asynk/tankontank/game/Map.java8
2 files changed, 7 insertions, 3 deletions
diff --git a/core/src/ch/asynk/tankontank/TankOnTank.java b/core/src/ch/asynk/tankontank/TankOnTank.java
index 407e051..44884c9 100644
--- a/core/src/ch/asynk/tankontank/TankOnTank.java
+++ b/core/src/ch/asynk/tankontank/TankOnTank.java
@@ -50,6 +50,7 @@ public class TankOnTank extends Game
debug("TankOnTank", " load assets : " + (Gdx.app.getJavaHeap()/1024.0f) + "KB");
manager.load("data/map_a.png", Texture.class);
manager.load("data/map_b.png", Texture.class);
+ manager.load("data/hex.png", Texture.class);
manager.load("data/hud.atlas", TextureAtlas.class);
manager.load("data/units.atlas", TextureAtlas.class);
manager.load("data/unit-overlays.atlas", TextureAtlas.class);
@@ -72,6 +73,7 @@ public class TankOnTank extends Game
debug("TankOnTank", "diagnostics:\n" + manager.getDiagnostics() );
manager.unload("data/map_a.png");
manager.unload("data/map_b.png");
+ manager.unload("data/hex.png");
manager.unload("data/hud.atlas");
manager.unload("data/units.atlas");
manager.unload("data/unit-overlays.atlas");
diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java
index 3123355..74449f9 100644
--- a/core/src/ch/asynk/tankontank/game/Map.java
+++ b/core/src/ch/asynk/tankontank/game/Map.java
@@ -11,6 +11,7 @@ import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import ch.asynk.tankontank.TankOnTank;
import ch.asynk.tankontank.engine.Pawn;
import ch.asynk.tankontank.engine.Board;
+import ch.asynk.tankontank.engine.SelectedTile;
import ch.asynk.tankontank.engine.Orientation;
import ch.asynk.tankontank.engine.Meteorology;
import ch.asynk.tankontank.engine.PossiblePaths;
@@ -86,7 +87,8 @@ public abstract class Map extends Board
public Map(final TankOnTank game, Board.Config cfg, String textureName)
{
- super(game.factory, cfg, game.manager.get(textureName, Texture.class));
+ super(game.factory, cfg, game.manager.get(textureName, Texture.class),
+ new SelectedTile(game.manager.get("data/hex.png", Texture.class), new float[] {.2f, .1f, .1f, .1f, .2f, .1f} ));
this.ctrl = game.ctrl;
this.moveSound = game.manager.get("sounds/move.mp3", Sound.class);
DiceAnimation.init(game.manager.get("data/dice.png", Texture.class), 16, 9, game.manager.get("sounds/dice.mp3", Sound.class));
@@ -483,8 +485,8 @@ public abstract class Map extends Board
public void showPath(Hex dst) { possiblePaths.enable(Hex.MOVE, true); showMove(dst); }
public void hidePath(Hex dst) { possiblePaths.enable(Hex.MOVE, false); hideMove(dst); }
- public void selectHex(Hex hex) { enableOverlayOn(hex, Hex.SELECT, true); }
- public void unselectHex(Hex hex) { enableOverlayOn(hex, Hex.SELECT, false); }
+ public void selectHex(Hex hex) { selectedTile.set(hex); }
+ public void unselectHex(Hex hex) { selectedTile.hide(); }
public void showMove(Hex hex) { enableOverlayOn(hex, Hex.MOVE, true); }
public void hideMove(Hex hex) { enableOverlayOn(hex, Hex.MOVE, false); }
public void showDirections(Hex hex) { enableOverlayOn(hex, Hex.DIRECTIONS, true); }