summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-10-06 16:33:37 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2014-10-06 16:33:37 +0200
commit644c17b7639a9cacc84f0ddf56dd836bb27e233a (patch)
treecceb67c59424da6947a77a9986d62c3958c3af8e /core/src/ch/asynk
parent07a12448acaf5749ebdd12ccddca0bfa7db23ded (diff)
downloadRustAndDust-644c17b7639a9cacc84f0ddf56dd836bb27e233a.zip
RustAndDust-644c17b7639a9cacc84f0ddf56dd836bb27e233a.tar.gz
GameCtrl: implements new GameState
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r--core/src/ch/asynk/tankontank/game/GameCtrl.java32
1 files changed, 22 insertions, 10 deletions
diff --git a/core/src/ch/asynk/tankontank/game/GameCtrl.java b/core/src/ch/asynk/tankontank/game/GameCtrl.java
index be26fd2..05e1ce0 100644
--- a/core/src/ch/asynk/tankontank/game/GameCtrl.java
+++ b/core/src/ch/asynk/tankontank/game/GameCtrl.java
@@ -4,9 +4,11 @@ import com.badlogic.gdx.utils.Disposable;
import ch.asynk.tankontank.TankOnTank;
import ch.asynk.tankontank.game.states.GameStateCommon;
-import ch.asynk.tankontank.game.states.GameStateNone;
-import ch.asynk.tankontank.game.states.GameStatePath;
+import ch.asynk.tankontank.game.states.GameStateView;
+import ch.asynk.tankontank.game.states.GameStateMove;
import ch.asynk.tankontank.game.states.GameStateDirection;
+import ch.asynk.tankontank.game.states.GameStateRotate;
+import ch.asynk.tankontank.game.states.GameStateAnimation;
public class GameCtrl implements Disposable
{
@@ -16,9 +18,11 @@ public class GameCtrl implements Disposable
public Map map;
public Hud hud;
- private GameState noneState;
+ private GameState viewState;
private GameState pathState;
- private GameState directionState ;
+ private GameState directionState;
+ private GameState rotateState;
+ private GameState animationState;
private GameState state;
@@ -30,11 +34,13 @@ public class GameCtrl implements Disposable
this.hud = new Hud(this, game);
this.map = factory.getMap(this, game.manager, GameFactory.MapType.MAP_A);
- this.noneState = new GameStateNone(this, map);
- this.pathState = new GameStatePath();
+ this.viewState = new GameStateView(this, map);
+ this.pathState = new GameStateMove();
this.directionState = new GameStateDirection();
+ this.rotateState = new GameStateRotate();
+ this.animationState = new GameStateAnimation();
- this.state = noneState;
+ this.state = viewState;
factory.fakeSetup(map);
}
@@ -50,15 +56,21 @@ public class GameCtrl implements Disposable
public void setState(GameState.State state)
{
switch(state) {
- case NONE:
- this.state = noneState;
+ case VIEW:
+ this.state = viewState;
break;
- case PATH:
+ case MOVE:
this.state = pathState;
break;
case DIRECTION:
this.state = directionState;
break;
+ case ROTATE:
+ this.state = rotateState;
+ break;
+ case ANIMATION:
+ this.state = animationState;
+ break;
default:
break;
}