diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-12 22:41:08 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-12 22:41:08 +0100 |
commit | 849b4301273f3460e9ac6c107823ad657aba065b (patch) | |
tree | 52669ce55b4bcd6357bd7f8cbc4ef78ff50d434b /core/src/ch | |
parent | f51ace0bc62cc5c48738b4a866aad4316f87f2cf (diff) | |
download | RustAndDust-849b4301273f3460e9ac6c107823ad657aba065b.zip RustAndDust-849b4301273f3460e9ac6c107823ad657aba065b.tar.gz |
Config: add debug option
Diffstat (limited to 'core/src/ch')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Config.java | 2 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/screens/GameScreen.java | 4 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/screens/OptionsScreen.java | 7 |
3 files changed, 12 insertions, 1 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Config.java b/core/src/ch/asynk/tankontank/game/Config.java index c2f933a..dbbf7bf 100644 --- a/core/src/ch/asynk/tankontank/game/Config.java +++ b/core/src/ch/asynk/tankontank/game/Config.java @@ -8,9 +8,11 @@ public class Config public boolean canCancel; public boolean mustValidate; public boolean showEnemyPossibilities; + public boolean debug; public Config() { + this.debug = false; this.showMoves = true; this.showTargets = true; this.showMoveAssists = true; diff --git a/core/src/ch/asynk/tankontank/screens/GameScreen.java b/core/src/ch/asynk/tankontank/screens/GameScreen.java index 9e82764..739a3e3 100644 --- a/core/src/ch/asynk/tankontank/screens/GameScreen.java +++ b/core/src/ch/asynk/tankontank/screens/GameScreen.java @@ -30,7 +30,7 @@ import ch.asynk.tankontank.game.battles.BattleHeadToHead; public class GameScreen implements Screen { - private static final boolean DEBUG = false; + private static boolean DEBUG = false; private static final float INPUT_DELAY = 0.1f; private static final float ZOOM_IN_MAX = 0.3f; @@ -66,6 +66,8 @@ public class GameScreen implements Screen this.ctrl = new Ctrl(game, new BattleHeadToHead(game.factory)); + DEBUG = game.config.debug; + virtualWidth = ctrl.map.getWidth(); virtualHeight = ctrl.map.getHeight(); diff --git a/core/src/ch/asynk/tankontank/screens/OptionsScreen.java b/core/src/ch/asynk/tankontank/screens/OptionsScreen.java index 365a855..f7752ae 100644 --- a/core/src/ch/asynk/tankontank/screens/OptionsScreen.java +++ b/core/src/ch/asynk/tankontank/screens/OptionsScreen.java @@ -26,6 +26,7 @@ public class OptionsScreen implements Screen private CheckBox canCancelCk; private CheckBox mustValidateCk; private CheckBox showEnemyPossibilitiesCk; + private CheckBox debugCk; public OptionsScreen(final TankOnTank game) { @@ -49,6 +50,7 @@ public class OptionsScreen implements Screen game.config.canCancel = canCancelCk.isChecked(); game.config.mustValidate = mustValidateCk.isChecked(); game.config.showEnemyPossibilities = showEnemyPossibilitiesCk.isChecked(); + game.config.debug = debugCk.isChecked(); } @Override @@ -67,6 +69,7 @@ public class OptionsScreen implements Screen canCancelCk = new CheckBox("Can Cancel", game.skin); mustValidateCk = new CheckBox("Must Validate", game.skin); showEnemyPossibilitiesCk = new CheckBox("Show Enemy Possibilities", game.skin); + debugCk = new CheckBox("Debug", game.skin); showMovesCk.setChecked(game.config.showMoves); showTargetsCk.setChecked(game.config.showTargets); @@ -74,6 +77,7 @@ public class OptionsScreen implements Screen canCancelCk.setChecked(game.config.canCancel); mustValidateCk.setChecked(game.config.mustValidate); showEnemyPossibilitiesCk.setChecked(game.config.showEnemyPossibilities); + debugCk.setChecked(game.config.debug); okButton.addListener(new InputListener() { public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) { @@ -92,6 +96,7 @@ public class OptionsScreen implements Screen stage.addActor(canCancelCk); stage.addActor(mustValidateCk); stage.addActor(showEnemyPossibilitiesCk); + stage.addActor(debugCk); stage.addActor(okButton); } @@ -117,6 +122,8 @@ public class OptionsScreen implements Screen mustValidateCk.setPosition(x, y); y -= 20f; showEnemyPossibilitiesCk.setPosition(x, y); + y -= 20f; + debugCk.setPosition(x, y); x += 200f; y -= 40f; okButton.setPosition(x, y); |