예제 #1
0
  private void takeShrineDown() {
    queue.addTweenFromNow(
        0.333f,
        2.666f,
        Tween.movePoint(shrineOff.position_).from(0, SHRINE_INITIAL_Y).to(0, SHRINE_FINAL_Y));
    queue.addTweenFromNow(
        0.333f,
        2.666f,
        new Tween() {
          @Override
          public void invoke(float t) {
            shrineOff.position_.x = Utils.random2Range(6 * t);
          }
        });
    // TODO: add shrine mask!

    queue.addTweenFromNow(
        0,
        0.5f,
        Tween.easeBothSin(
            new Tween() {
              @Override
              public void invoke(float t) {
                shrineGlowAlpha = 1 - t;
              }
            }));
  }
예제 #2
0
 private void closdDoor() {
   queue.addTweenFromNow(
       0.333f,
       2.666f,
       new Tween.EaseBoth2(
           Tween.movePoint(door.position_).from(DOOR_X, DOOR_INITIAL_Y).to(DOOR_X, DOOR_FINAL_Y)));
   queue.addTweenFromNow(
       0.333f,
       2.666f,
       new Tween.EaseBoth2(
           new Tween() {
             @Override
             public void invoke(float t) {
               doorLightScale = 1 - t;
             }
           }));
 }
예제 #3
0
  private void bossWakesUp() {
    bossAwake.setRotation(BOSS_AWAKE_INITIAL_ROTATION);

    queue.addTweenFromNow(
        1.833f,
        0.666f,
        new Tween() {
          @Override
          public void invoke(float t) {
            bossAngryGlow.setAlpha(t);
          }
        });
    queue.addTweenFromNow(
        1.833f,
        0.666f,
        new Tween() {
          @Override
          public void invoke(float t) {
            bossAngryGlow.setAlpha(t);
            bossAngryGlowAdd.setAlpha(t);
          }
        });
    queue.addTweenFromNow(1.833f + 0.666f, 0.666f, bossEyesAddTween);

    queue.addTweenFromNow(3f, 0.233f, scaleSleepingBossTween(1, 0.97f));
    queue.addTweenFromNow(3.233f, 0.067f, scaleSleepingBossTween(0.97f, 1.02f));
    queue.addTweenFromNow(3.3f, 0.7f, scaleSleepingBossTween(1.02f, 1f));
    queue.addTweenFromNow(4f, 0.233f, scaleSleepingBossTween(1, 0.97f));
    queue.addTweenFromNow(4.233f, 0.067f, scaleSleepingBossTween(0.97f, 1.05f));
    queue.addTweenFromNow(4.3f, 0.7f, scaleSleepingBossTween(1.05f, 1f));
    queue.addTweenFromNow(5.333f, 0.233f, scaleSleepingBossTween(1, 0.80f));
    queue.addTweenFromNow(5.567f, 0.067f, scaleSleepingBossTween(0.80f, 1.20f));

    queue.addTweenFromNow(3.3f, 0.7f, bossEyesAddTween);
    queue.addTweenFromNow(4.3f, 0.7f, bossEyesAddTween);
    queue.addTweenFromNow(5.567f, 0.5f, bossEyesAddTween);

    // From here the boss is released.
    queue.addEventFromNow(
        5.633f + 0.5f,
        new EventQueue.Event() {
          @Override
          public void invoke() {
            bossSleeps.setAlpha(0);
            bossAngryGlow.setAlpha(0);
            bossAngryGlowAdd.setAlpha(0);
          }
        });
    queue.addTweenFromNow(5.633f, 0.5f, scaleSleepingBossTween(1.2f, 1));
    queue.addTweenFromNow(5.633f, 0.5f, Tween.alpha(bossAwake));
    queue.addTweenFromNow(5.633f, 0.5f, Tween.tint(bossAwake));

    queue.addTweenFromNow(
        5.633f, 0.5f, Tween.easeBothSin(Tween.tSpan(1.2f, 1, Tween.scale(bossAwake))));
    queue.addTweenFromNow(
        6.25f,
        1f,
        Tween.easeBothQuad(
            Tween.movePoint(bossAwake.position_).fromX(BOSS_AWAKE_INITIAL_X).toX(0)));

    queue.addTweenFromNow(
        6.25f,
        1.7f,
        Tween.easeBothSin(
            Tween.movePoint(bossAwake.position_)
                .fromY(BOSS_AWAKE_INITIAL_Y)
                .toY(BOSS_AWAKE_TOP_Y)));

    queue.addTweenFromNow(
        6.25f, 0.5f, Tween.tSpan(BOSS_AWAKE_INITIAL_ROTATION, 0, Tween.rotate(bossAwake)));

    queue.addEventFromNow(
        7.0f,
        new EventQueue.Event() {
          @Override
          public void invoke() {
            bossAwake.setState_(BossGraphic.State.DARK);
          }
        });
    queue.addEventFromNow(
        9.25f,
        new EventQueue.Event() {
          @Override
          public void invoke() {
            bossAwake.setState_(BossGraphic.State.HIDDEN);
          }
        });

    queue.addTweenFromNow(
        8.25f,
        1f,
        Tween.easeIn(
            Tween.movePoint(bossAwake.position_)
                .fromY(BOSS_AWAKE_TOP_Y)
                .toY(WorldRenderer.FRUSTUM_HEIGHT + 200)));

    // Roots shake.
    Tween rootsShake =
        new Tween() {
          @Override
          public void invoke(float t) {
            bossSleepsRoots.position_.x = BOSS_X + Utils.random2Range(7 * (1 - t));
          }
        };
    queue.addTweenFromNow(3.3f, 0.5f, rootsShake);
    queue.addTweenFromNow(4.3f, 0.5f, rootsShake);
    queue.addTweenFromNow(5.567f, 0.5f, rootsShake);
    queue.addTweenFromNow(
        5.567f,
        0.5f,
        new Tween() {
          @Override
          public void invoke(float t) {
            bossSleepsRoots.setScaleY(1 - t);
            bossSleepsRoots.position_.y = BOSS_Y - t * 109;
          }
        });
  }