@Override public void render(ShapeRenderer shapes, SpriteBatch batch) { bossSleeps.render(batch); renderBossEyes(batch); bossSleepsGlow.render(batch); bossAngryGlow.render(batch); bossAngryGlowAdd.render(batch); bossAwake.render(batch); bossSleepsRoots.render(batch); renderShrine(shapes, batch); door_back.render(batch); leftTorch.render(batch); rightTorch.render(batch); BatchUtils.setBlendFuncAdd(batch); leftTorchFire.setTint(shrineGlowAlpha); leftTorchFire.render(batch); leftTorchGlow.setTint((shrineGlowAlpha) * (doorLightScale - (float) Math.random() * 0.1f)); leftTorchGlow.render(batch); rightTorchFire.setTint(shrineGlowAlpha); rightTorchFire.render(batch); rightTorchGlow.setTint((shrineGlowAlpha) * (doorLightScale - (float) Math.random() * 0.1f)); rightTorchGlow.render(batch); BatchUtils.setBlendFuncNormal(batch); }
@Override public void update(float deltaTime) { stateTime += deltaTime; bossStateTime += deltaTime; queue.update(deltaTime); leftTorchFire.update(deltaTime); rightTorchFire.update(deltaTime); bossAwake.update(deltaTime); }
public NewGameOpening() { leftTorch = new StaticGraphicObject(Assets.openingTorch, -217, 349); // TODO: offset phase of animation. rightTorch = new StaticGraphicObject(Assets.openingTorch, 217, 349) { @Override public void render(Batch batch) { Sprite s = getSprite(); s.setFlip(true, false); Utils.drawCenter(batch, s, position_.x, position_.y); } }; bossAngryGlow.setAlpha(0); bossAngryGlowAdd.setAlpha(0); bossAwake.setAlpha(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; } }); }