diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-09-15 23:29:54 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-09-15 23:29:54 +0200 |
commit | 6d2d6942b67afccb0b2024c408f4e963758fc975 (patch) | |
tree | ffdd3ae24694836a7a48a1ab03ff8bf1f9007b7c /core/src/ch/asynk | |
parent | 93bfeff7573f12278ed07954f7866d9635e51b1d (diff) | |
download | RustAndDust-6d2d6942b67afccb0b2024c408f4e963758fc975.zip RustAndDust-6d2d6942b67afccb0b2024c408f4e963758fc975.tar.gz |
GameScreen: uses UnitFactory
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r-- | core/src/ch/asynk/tankontank/screens/GameScreen.java | 13 |
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 |