summaryrefslogtreecommitdiffstats
path: root/core/src
diff options
context:
space:
mode:
Diffstat (limited to 'core/src')
-rw-r--r--core/src/ch/asynk/tankontank/screens/GameScreen.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/core/src/ch/asynk/tankontank/screens/GameScreen.java b/core/src/ch/asynk/tankontank/screens/GameScreen.java
index b347741..6762e7d 100644
--- a/core/src/ch/asynk/tankontank/screens/GameScreen.java
+++ b/core/src/ch/asynk/tankontank/screens/GameScreen.java
@@ -27,6 +27,9 @@ import com.badlogic.gdx.utils.viewport.ScreenViewport;
import ch.asynk.tankontank.TankOnTank;
import ch.asynk.tankontank.actors.Pawn;
import ch.asynk.tankontank.actors.HexMap;
+import ch.asynk.tankontank.actors.Unit;
+import ch.asynk.tankontank.utils.UnitFactory;
+import ch.asynk.tankontank.utils.UnitFactory.UnitType;
public class GameScreen extends AbstractScreen
{
@@ -70,12 +73,21 @@ public class GameScreen extends AbstractScreen
gameStage.addActor(map);
gameStage.addActor(selectedHex);
+ UnitFactory.init(game.manager, map);
+
hud = new Stage(new ScreenViewport());
hud.addActor(fps);
Gdx.input.setInputProcessor(getMultiplexer());
}
+ private void addUnit(Stage stage, UnitType t, int col, int row, int angle)
+ {
+ Unit u = UnitFactory.getUnit(t);
+ u.moveTo(col, row, angle);
+ stage.addActor(u);
+ }
+
private InputMultiplexer getMultiplexer()
{
final InputMultiplexer multiplexer = new InputMultiplexer();
@@ -193,6 +205,7 @@ public class GameScreen extends AbstractScreen
Gdx.app.debug("GameScreen", "dispose()");
hud.dispose();
gameStage.dispose();
+ UnitFactory.dispose();
}
@Override