Exemple #1
0
 internal void SetNextGameScreen (BaseGameScreen setNextGameScreen)
 {
    nextGameScreen = setNextGameScreen;
 }
Exemple #2
0
      /// <summary>
      /// Allows the game to run logic such as updating the world,
      /// checking for collisions, gathering input, and playing audio.
      /// </summary>
      /// <param name="gameTime">Provides a snapshot of timing values.</param>
      protected override void Update (GameTime gameTime)
      {
         Performance.Push("Game loop");
         Platform.Input.UpdateInput (gameTime);

         if (nextGameScreen != null) 
         {
            if (currentGameScreen != null)
               currentGameScreen.Close ();

            currentGameScreen = nextGameScreen;
            if (currentGameScreen != null)
               currentGameScreen.InitUI ();

            nextGameScreen = null;
         }

         if (currentGameScreen != null) 
         {
            currentGameScreen.Update (gameTime);
         }

         base.Update (gameTime);
         Performance.Pop();
      }
Exemple #3
0
      public MainGame ()
      {
         MainGame.WinWarGame = this;

         Log.Severity = LogSeverity.Debug;
         Log.Type = LogType.Performance;

         this.IsMouseVisible = false;

         this.IsFixedTimeStep = false;

         backgroundClearColor = new Color (0x7F, 0x00, 0x00);

         currentGameScreen = null;
         nextGameScreen = null;

         _graphics = new GraphicsDeviceManager (this);
#if !NETFX_CORE
         _graphics.PreferredBackBufferWidth = 320 * 3;
         _graphics.PreferredBackBufferHeight = 200 * 3;
         _graphics.ApplyChanges ();
#endif

         Content.RootDirectory = "Assets";

#if IOS
         MouseCursor.IsVisible = false;
#endif
      }