Exemplo n.º 1
0
 /**
  * <b>DO NOT CALL THIS METHOD</b>
  *
  * <p>This method is part of the Android Activity lifecycle which is managed by GameEngine itself.
  */
 @Override
 protected final void onDestroy() {
   super.onDestroy();
   printDebugInfo("GameEngine", "onDestroy...");
   GameSound.cleanup();
   MusicPlayer.stop();
 }
Exemplo n.º 2
0
  /**
   * <b>DO NOT CALL THIS METHOD</b>
   *
   * <p>This method is part of the Android Activity lifecycle which is managed by GameEngine itself.
   */
  @Override
  protected final void onPause() {
    super.onPause();
    printDebugInfo("GameEngine", "OnPause...");

    pause();
    GameSound.pauseSounds();
    MusicPlayer.pauseAll();

    MotionSensor.handleOnPause(this);
  }
Exemplo n.º 3
0
  /**
   * <b>DO NOT CALL THIS METHOD</b>
   *
   * <p>This method is part of the Android Activity lifecycle which is managed by GameEngine itself.
   */
  @Override
  protected final void onResume() {
    super.onResume();
    printDebugInfo("GameEngine", "onResume()...");
    // Note: only restart thread after a real pause, not at startup
    if (gameThread != null) {
      if (gameThread.getState() == Thread.State.TERMINATED) {
        startThread();
      }
    }
    GameSound.resumeSounds();
    MusicPlayer.resumeAll();

    MotionSensor.handleOnResume(this);
  }