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;
             }
     }
 }
Example #2
0
 protected override void LoadContent()
 {
     // Create a new SpriteBatch, which can be used to draw textures.
     //AspectRatio = GraphicsDevice.Viewport.AspectRatio;
     //OldWindowSize = new Point(Window.ClientBounds.Width, Window.ClientBounds.Height);
     spriteBatch = new SpriteBatch(GraphicsDevice);
     init = new Initializer(spriteBatch, this);
     state = init;
 }