Esempio n. 1
0
 public StateHandler()
 {
     _score = 0;
     _gamestate = GameState.Menu;
     _menustate = MenuState.MainMenu;
     _levelstate = LevelState.Level1;
     _transitionstate = TransitionState.LevelStart;
     _characterstate = CharacterState.Standing;
     _characterskin = Skins.Mario;
     _nextgamestate = GameState.Menu;
     _nextmenustate = MenuState.MainMenu;
     _nextlevelstate = LevelState.Level1;
     _nexttransitionstate = TransitionState.LevelStart;
     _nextcharacterstate = CharacterState.Standing;
     _nextcharacterskin = Skins.Mario;
     _cursor = MenuCursor.PlayGame;
     _keyscursor = 1;
     _skinscursor = 1;
 }
 /// <summary>
 /// Switches the current game state.
 /// </summary>
 /// <param name="newState">New state.</param>
 public static void SwitchState(GameState newState)
 {
     EndCurrentState();
     AddNewState(newState);
 }
 /// <summary>
 /// Adds a new state to the stack.
 /// </summary>
 /// <param name="state">State.</param>
 public static void AddNewState(GameState state)
 {
     _state.Push(state);
 }
Esempio n. 4
0
 public void ChangeState(GameState next)
 {
     _nextgamestate = next;
 }
Esempio n. 5
0
 public void Run()
 {
     _gamestate = _nextgamestate;
     _menustate = _nextmenustate;
     _levelstate = _nextlevelstate;
     _transitionstate = _nexttransitionstate;
     _characterstate = _nextcharacterstate;
     _characterskin = _nextcharacterskin;
 }
Esempio n. 6
0
 /// <summary>
 /// Move the game to a new state. The current state is maintained
 /// so that it can be returned to.
 /// </summary>
 /// <param name="state">the new game state</param>
 public static void AddNewState(GameState state)
 {
     _state.Push(state);
     UtilityFunctions.Message = "";
 }
Esempio n. 7
0
 /// <summary>
 /// Move the game to a new state. The current state is maintained
 /// so that it can be returned to.
 /// </summary>
 /// <param name="state">the new game state</param>
 public static void AddNewState(GameState state)
 {
     _state.Push(state);
     Message = "";
 }
 /// <summary>
 /// Adds the state.
 /// </summary>
 /// <param name="state">State.</param>
 public static void AddState(GameState state)
 {
     _states.Push (state);
 }
 /// <summary>
 /// End the current state and add in the new state.
 /// </summary>
 /// <param name="newState">the new state of the game</param>
 public static void SwitchState(GameState newState)
 {
     EndCurrentState();
     AddNewState(newState);
 }
 /// <summary>
 /// Move the game to a new state. The current state is maintained
 /// so that it can be returned to.
 /// </summary>
 /// <param name="state">the new game state</param>
 public static void AddNewState(GameState state)
 {
     _state.Push(state);
     UtilityFunctions.Message = "";
 }