protected override IRenderable createInstance()
 {
     if (GameStateMachine.getInstance().LevelContext == null)
     {
         resetContext();
     }
     //	return new GameDisplay(device, content, "Map" + GameStateMachine.getInstance().LevelContext.MapIndex);
     return(new GameDisplay(device, content, "Pathing"));
     //return new GameDisplay(device, content, "Map4");
 }
Exemplo n.º 2
0
        protected void resetContext()
        {
            LevelContext context = new LevelContext()
            {
                Ghosts   = new List <Model.Ghost>(),
                MapIndex = 1
            };

            GameStateMachine.getInstance().LevelContext = context;
        }
        public override void goToNextState()
        {
            LevelContext context = GameStateMachine.getInstance().LevelContext;

            context.MapIndex += 1;
            if (context.MapIndex == 5)
            {
                resetContext();
                changeState(GameStateMachine.getInstance().GameFinishedState);
            }
            else
            {
                changeState(GameStateMachine.getInstance().GameDisplay);
                GameStateMachine.getInstance().LevelContext = context;
            }
            // don't call the base or the context will be reset
            //base.goToNextState();
        }
Exemplo n.º 4
0
 public override void goToNextState()
 {
     changeState(GameStateMachine.getInstance().GameDisplay);
     base.goToNextState();
 }
Exemplo n.º 5
0
 public override void goToPreviousState()
 {
     changeState(GameStateMachine.getInstance().ExitState);
 }
Exemplo n.º 6
0
 public void pushToTutorial()
 {
     changeState(GameStateMachine.getInstance().Tutorial);
     base.goToPreviousState();
 }
 public override void goToPreviousState()
 {
     changeState(GameStateMachine.getInstance().MainMenu);
     base.goToPreviousState();
 }
Exemplo n.º 8
0
 public override void goToNextState()
 {
     changeState(GameStateMachine.getInstance().TutorialComplete);
     base.goToNextState();
 }
 public void goToGameOver()
 {
     changeState(GameStateMachine.getInstance().GameOverState);
 }
Exemplo n.º 10
0
 protected void changeState(State newState)
 {
     setStates();
     GameStateMachine.getInstance().CurrentState = newState;
     GameStateMachine.getInstance().CurrentState.reset();
 }