Example #1
0
 public void changeGameState(string newState)
 {
     switch (newState)
     {
         case "playing":
             {
                 playing = new Playing(spriteBatch, this);
                 state.leaving();
                 state = playing;
                 state.entering();
                 break;
             }
         case "initialize":
             {
                 init = new Initializer(spriteBatch, this);
                 state.leaving();
                 state = init;
                 state.entering();
                 break;
             }
         case "title":
             {
                 title = new TitleCard(spriteBatch, this);
                 state.leaving();
                 state = title;
                 state.entering();
                 break;
             }
     }
 }