示例#1
0
  @Override
  public void present(float deltaTime) {
    GLCommon gl = Gdx.gl;
    gl.glClear(GL10.GL_COLOR_BUFFER_BIT);

    camera.update();

    worldRender.render(deltaTime);
    if (isTreasure) {
      batcher.begin();
      renderTreasure(treasureType);
      if (isTreasureSound) {
        Assets.playSound(Assets.treasureSound, game.soundState);
        isTreasureSound = false;
      }
      batcher.end();
    } else if (isFinal) {
      batcher.begin();
      renderFinal();
      batcher.end();
    } else {
      if (isPause && !isDialog) {
        batcher.begin();
        renderGamePause();
        batcher.end();
      }
    }
    if ((isPause || !game.soundState) && bgMusic.isPlaying()) {
      bgMusic.pause();
    } else if (!isPause && !bgMusic.isPlaying() && game.soundState) {
      Assets.playMusic(bgMusic, game.soundState);
    }
  }
示例#2
0
 public void musicPause() {
   preferences.putBoolean("musicOn", false);
   preferences.flush();
   music.pause();
 }
 public void pauseMusic() {
   if (music != null && music.isPlaying()) {
     music.pause();
     isMusicPaused = true;
   }
 }
示例#4
0
 public static void disable() {
   enabled = false;
   if (music != null) {
     music.pause();
   }
 }
示例#5
0
 public static void pause() {
   if (music != null) {
     music.pause();
   }
 }
示例#6
0
 @Override
 public void pause() {
   bgMusic.pause();
 }