Ejemplo n.º 1
0
 public GameState(Game game, GameStateManeger _stateManeger)
     : base(game)
 {
     StateManeger = _stateManeger;
     childComponents = new List<GameComponent>();
     tag = this;
     this.game = game;
     Song = game.Content.Load<Song>("Music/Vogel im Kafig");
 }
Ejemplo n.º 2
0
        public void ChangeState(GameState newState)
        {
            while (gameStates.Count > 0)
                RemoveState();

            newState.DrawOrder = startDrawOrder;
            drawOrder = startDrawOrder;

            AddState(newState);

            if (OnStateChange != null)
                OnStateChange(this, null);
        }
Ejemplo n.º 3
0
        public void PushState(GameState newState)
        {
            drawOrder += drawOrderInc;
            newState.DrawOrder = drawOrder;
            AddState(newState);

            if (OnStateChange != null)
                OnStateChange(this, new EventArgs());
        }
Ejemplo n.º 4
0
        private void AddState(GameState newState)
        {
            gameStates.Push(newState);

            Game.Components.Add(newState);

            OnStateChange += newState.StateChange;
        }