summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-09-27 23:59:24 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2014-09-27 23:59:24 +0200
commit56ac560950033775345ea83dfa65aeb71ed4f92f (patch)
tree242c4baeaea41907f5284d7c3663c3dcaf70e384 /core
parent6c8f238f479ecaffa6c062055cd7ab19cc93be7c (diff)
downloadRustAndDust-56ac560950033775345ea83dfa65aeb71ed4f92f.zip
RustAndDust-56ac560950033775345ea83dfa65aeb71ed4f92f.tar.gz
add MapA
Diffstat (limited to 'core')
-rw-r--r--core/src/ch/asynk/tankontank/TankOnTank.java4
-rw-r--r--core/src/ch/asynk/tankontank/game/GameFactory.java2
-rw-r--r--core/src/ch/asynk/tankontank/game/MapB.java74
3 files changed, 77 insertions, 3 deletions
diff --git a/core/src/ch/asynk/tankontank/TankOnTank.java b/core/src/ch/asynk/tankontank/TankOnTank.java
index c9f29c9..c2283dc 100644
--- a/core/src/ch/asynk/tankontank/TankOnTank.java
+++ b/core/src/ch/asynk/tankontank/TankOnTank.java
@@ -31,7 +31,7 @@ public class TankOnTank extends Game
{
Gdx.app.debug("TankOnTank", " load assets : " + (Gdx.app.getJavaHeap()/1024.0f) + "KB");
manager.load("images/map_a.png", Texture.class);
- // manager.load("images/map_b.png", Texture.class);
+ manager.load("images/map_b.png", Texture.class);
manager.load("images/dice.pack", TextureAtlas.class);
manager.load("images/counters.pack", TextureAtlas.class);
manager.load("images/ge.atlas", TextureAtlas.class);
@@ -47,7 +47,7 @@ public class TankOnTank extends Game
Gdx.app.debug("TankOnTank", "unload assets : " + (Gdx.app.getJavaHeap()/1024.0f) + "KB");
Gdx.app.debug("TankOnTank", "diagnostics:\n" + manager.getDiagnostics() );
manager.unload("images/map_a.png");
- // manager.unload("images/map_b.png");
+ manager.unload("images/map_b.png");
manager.unload("images/dice.pack");
manager.unload("images/counters.pack");
manager.unload("images/ge.atlas");
diff --git a/core/src/ch/asynk/tankontank/game/GameFactory.java b/core/src/ch/asynk/tankontank/game/GameFactory.java
index 6558fc4..46d0872 100644
--- a/core/src/ch/asynk/tankontank/game/GameFactory.java
+++ b/core/src/ch/asynk/tankontank/game/GameFactory.java
@@ -139,7 +139,7 @@ public class GameFactory implements Board.TileBuilder, Disposable
m = new MapA(this, config(), manager.get("images/map_a.png", Texture.class));
break;
case MAP_B:
- // m = new Map(config(), manager.get("images/map_b.png", Texture.class), hexAtlas);
+ m = new MapB(this, config(), manager.get("images/map_b.png", Texture.class));
break;
}
diff --git a/core/src/ch/asynk/tankontank/game/MapB.java b/core/src/ch/asynk/tankontank/game/MapB.java
new file mode 100644
index 0000000..cdce945
--- /dev/null
+++ b/core/src/ch/asynk/tankontank/game/MapB.java
@@ -0,0 +1,74 @@
+package ch.asynk.tankontank.game;
+
+import com.badlogic.gdx.graphics.Texture;
+import com.badlogic.gdx.graphics.g2d.TextureAtlas;
+
+import ch.asynk.tankontank.engine.Board;
+
+public class MapB extends Map
+{
+ public MapB(GameFactory gameFactory, Board.Config cfg, Texture texture)
+ {
+ super(gameFactory, cfg, texture);
+ }
+
+ @Override
+ protected void setup()
+ {
+ getHex(4, 0).terrain = Hex.Terrain.HILLS;
+ getHex(5, 0).terrain = Hex.Terrain.HILLS;
+ getHex(1, 1).terrain = Hex.Terrain.HILLS;
+ getHex(9, 7).terrain = Hex.Terrain.HILLS;
+ getHex(10, 7).terrain = Hex.Terrain.HILLS;
+
+ getHex(3, 0).terrain = Hex.Terrain.WOODS;
+ getHex(6, 0).terrain = Hex.Terrain.WOODS;
+ getHex(8, 1).terrain = Hex.Terrain.WOODS;
+ getHex(9, 2).terrain = Hex.Terrain.WOODS;
+ getHex(4, 5).terrain = Hex.Terrain.WOODS;
+ getHex(5, 6).terrain = Hex.Terrain.WOODS;
+ getHex(6, 6).terrain = Hex.Terrain.WOODS;
+ getHex(11, 8).terrain = Hex.Terrain.WOODS;
+
+ getHex(1, 2).terrain = Hex.Terrain.TOWN;
+ getHex(5, 3).terrain = Hex.Terrain.TOWN;
+ getHex(6, 4).terrain = Hex.Terrain.TOWN;
+ getHex(7, 8).terrain = Hex.Terrain.TOWN;
+
+ getHex(10, 1).terrain = Hex.Terrain.OFFMAP;
+ getHex(11, 3).terrain = Hex.Terrain.OFFMAP;
+ getHex(12, 5).terrain = Hex.Terrain.OFFMAP;
+ getHex(13, 7).terrain = Hex.Terrain.OFFMAP;
+
+ int N = Map.Orientation.NORTH.s;
+ int S = Map.Orientation.SOUTH.s;
+ int NE = Map.Orientation.NORTH_EAST.s;
+ int NW = Map.Orientation.NORTH_WEST.s;
+ int SE = Map.Orientation.SOUTH_EAST.s;
+ int SW = Map.Orientation.SOUTH_WEST.s;
+
+ getHex(1, 2).roads = (S | NW);
+ getHex(2, 3).roads = (SE | N);
+ getHex(3, 3).roads = (S | N);
+ getHex(4, 3).roads = (S | N);
+ getHex(5, 3).roads = (S | NW);
+ getHex(6, 4).roads = (SE | N);
+ getHex(7, 4).roads = (S | N);
+ getHex(8, 4).roads = (S | SW | N);
+ getHex(9, 4).roads = (S | N);
+ getHex(10, 4).roads = (S | N);
+ getHex(11, 4).roads = (S | N);
+ getHex(4, 8).roads = (S | N);
+ getHex(5, 8).roads = (S | N);
+ getHex(6, 8).roads = (S | N);
+ getHex(7, 8).roads = (S | N);
+ getHex(8, 8).roads = (S | NE);
+ getHex(8, 7).roads = (SW | NE);
+ getHex(8, 6).roads = (SW | NE | N);
+ getHex(8, 5).roads = (SW | NE);
+ getHex(9, 6).roads = (S | N);
+ getHex(10, 6).roads = (S | N);
+ getHex(11, 6).roads = (S | N);
+ getHex(12, 6).roads = (S | N);
+ }
+}