Search in sources :

Example 1 with AnimatedTexture

use of com.almasb.fxgl.texture.AnimatedTexture in project FXGL by AlmasB.

the class ScifiSample method seerCutscene.

private void seerCutscene() {
    // TODO: on cutscene end()
    // TODO: also why does player keep moving, input not cleared?
    getGameplay().getCutsceneManager().startCutscene("seer.txt");
    AnimatedTexture anim = getAssetLoader().loadTexture("player.png").toAnimatedTexture(3, Duration.seconds(0.5));
    // TODO: wrong behavior?
    anim.start(getStateMachine().getCurrentState());
    anim.setScaleX(-3);
    anim.setScaleY(3);
    anim.setTranslateX(getWidth() / 2);
    anim.setTranslateY(getHeight() / 2);
    getGameScene().addUINode(anim);
    Animation<?> anim2 = getUIFactory().fadeOut(anim, Duration.seconds(1.75));
    anim2.setOnFinished(() -> {
        getGameScene().removeUINode(anim);
        QTE qte = getGameplay().getQTE();
        qte.start(yes -> {
        }, Duration.seconds(3), KeyCode.W, KeyCode.W, KeyCode.D, KeyCode.A);
    });
    anim2.startInPlayState();
    addRain();
    initLiquid();
}
Also used : QTE(com.almasb.fxgl.gameplay.qte.QTE) AnimatedTexture(com.almasb.fxgl.texture.AnimatedTexture)

Aggregations

QTE (com.almasb.fxgl.gameplay.qte.QTE)1 AnimatedTexture (com.almasb.fxgl.texture.AnimatedTexture)1