Ejemplo n.º 1
0
        internal Game(AccelerometerHandlerDelegate accelerometerHandler)
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            graphics.IsFullScreen              = true;
            graphics.PreferredBackBufferWidth  = 800;
            graphics.PreferredBackBufferHeight = 480;
            graphics.SupportedOrientations     = DisplayOrientation.Portrait;

            GetAccelerometerVector = accelerometerHandler;
            _onGamePause           = null;
            _onGameResume          = null;

            _currentGameState = GameState.LOADING;
        }
Ejemplo n.º 2
0
 void OnGameStateChangeHandler(GameState prevGameState, GameState newGameState)
 {
     if (newGameState == GameState.STARTING)
     {
         OnGameStart?.Invoke();
     }
     else if (newGameState == GameState.GAMEOVER)
     {
         OnGameOver?.Invoke();
     }
     else if (newGameState == GameState.PAUSED)
     {
         OnGamePause?.Invoke();
     }
     else if (newGameState == GameState.PLAYING)
     {
         if (prevGameState == GameState.PAUSED)
         {
             OnGameResume?.Invoke();
         }
     }
 }
Ejemplo n.º 3
0
 public void ResumeTheGame()
 {
     DebugManager.LogWithColor("Game Has Resume", Color.green);
     OnGameResume?.Invoke();
     _OnGameResume?.Invoke();
 }
Ejemplo n.º 4
0
 public void GameResume()
 {
     OnGameResume?.Invoke();
 }