diff options
Diffstat (limited to 'core/src/ch')
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/Ctrl.java | 12 | ||||
-rw-r--r-- | core/src/ch/asynk/rustanddust/screens/GameScreen.java | 3 |
2 files changed, 13 insertions, 2 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/Ctrl.java b/core/src/ch/asynk/rustanddust/game/Ctrl.java index e793ba0..302ca87 100644 --- a/core/src/ch/asynk/rustanddust/game/Ctrl.java +++ b/core/src/ch/asynk/rustanddust/game/Ctrl.java @@ -4,6 +4,7 @@ import com.badlogic.gdx.utils.Disposable; import ch.asynk.rustanddust.RustAndDust; import ch.asynk.rustanddust.ui.Position; +import ch.asynk.rustanddust.game.ctrl.Solo; import ch.asynk.rustanddust.game.State.StateType; import ch.asynk.rustanddust.game.states.StateCommon; import ch.asynk.rustanddust.game.states.StateSelect; @@ -45,6 +46,17 @@ public abstract class Ctrl implements Disposable private StateType stateType; private StateType stateAfterAnimation; + public static Ctrl getCtrl(final RustAndDust game) + { + Ctrl ctrl = null; + switch(game.config.gameMode) { + case SOLO: + ctrl = new Solo(game, game.config.battle); + break; + } + return ctrl; + } + public Ctrl(final RustAndDust game, final Battle battle) { game.ctrl = this; diff --git a/core/src/ch/asynk/rustanddust/screens/GameScreen.java b/core/src/ch/asynk/rustanddust/screens/GameScreen.java index cc49263..a4c6bd6 100644 --- a/core/src/ch/asynk/rustanddust/screens/GameScreen.java +++ b/core/src/ch/asynk/rustanddust/screens/GameScreen.java @@ -19,7 +19,6 @@ import com.badlogic.gdx.math.Vector3; import ch.asynk.rustanddust.RustAndDust; import ch.asynk.rustanddust.game.Ctrl; -import ch.asynk.rustanddust.game.ctrl.Solo; public class GameScreen implements Screen { @@ -59,7 +58,7 @@ public class GameScreen implements Screen this.blocked = false; this.batch = new SpriteBatch(); - this.ctrl = new Solo(game, game.config.battle); + this.ctrl = Ctrl.getCtrl(game); this.cam = new GameCamera(ctrl.map.getWidth(), ctrl.map.getHeight(), ZOOM_OUT_MAX, ZOOM_IN_MAX, game.hudCorrection, FIXED_HUD); if (DEBUG) this.debugShapes = new ShapeRenderer(); |