summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-09-23 15:38:12 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2014-09-23 15:38:12 +0200
commit494a152f99bbceff721f283f46724ecafa40896a (patch)
tree37ee492a50745c2a7ce1016138a0d9b5711350dc /core/src/ch/asynk/tankontank
parent34e7c6dcf2d8dc9707fa36338abd538cf5fd15c7 (diff)
downloadRustAndDust-494a152f99bbceff721f283f46724ecafa40896a.zip
RustAndDust-494a152f99bbceff721f283f46724ecafa40896a.tar.gz
update GameScreen
Diffstat (limited to 'core/src/ch/asynk/tankontank')
-rw-r--r--core/src/ch/asynk/tankontank/screens/GameScreen.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/core/src/ch/asynk/tankontank/screens/GameScreen.java b/core/src/ch/asynk/tankontank/screens/GameScreen.java
index 48983d4..7e53900 100644
--- a/core/src/ch/asynk/tankontank/screens/GameScreen.java
+++ b/core/src/ch/asynk/tankontank/screens/GameScreen.java
@@ -43,6 +43,7 @@ public class GameScreen implements Screen
private static final int DRAGGED_Z_INDEX = 10;
private final TankOnTank game;
+ private GameFactory factory;
private float maxZoomOut;
private final SpriteBatch mapBatch;
@@ -51,8 +52,8 @@ public class GameScreen implements Screen
private final ShapeRenderer debugShapes;
private Map map;
- private Label fps;
+ private Label fps;
private Stage hud;
private Vector2 screenToViewport = new Vector2(); // ratio
@@ -65,12 +66,12 @@ public class GameScreen implements Screen
{
this.game = game;
- GameFactory.init(game.manager);
+ factory = new GameFactory(game.manager);
fps = new Label("FPS: 0", game.skin);
fps.setPosition( 10, Gdx.graphics.getHeight() - 40);
- map = GameFactory.getMap(game.manager, GameFactory.MapType.MAP_A);
+ map = factory.getMap(game.manager, GameFactory.MapType.MAP_A);
mapBatch = new SpriteBatch();
cam = new OrthographicCamera();
@@ -107,7 +108,7 @@ public class GameScreen implements Screen
private void addUnit(int col, int row, Board.Orientation o, UnitType t)
{
- Pawn p = GameFactory.getUnit(t);
+ Pawn p = factory.getUnit(t);
map.setPawnAt(p, col, row, o);
}
@@ -231,7 +232,7 @@ public class GameScreen implements Screen
// Gdx.app.debug("GameScreen", "dispose()");
hud.dispose();
map.dispose();
- GameFactory.dispose();
+ factory.dispose();
game.unloadAssets();
mapBatch.dispose();
debugShapes.dispose();