Skip to content

Instantly share code, notes, and snippets.

Created January 20, 2017 05:06

Revisions

  1. @invalid-email-address Anonymous created this gist Jan 20, 2017.
    48 changes: 48 additions & 0 deletions shake.qml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,48 @@
    ParallelAnimation {

    id: shake_card
    running: false
    alwaysRunToEnd: true

    ParallelAnimation {

    ColorAnimation { target: thefirstword; property: "color" ; to: first_word_color;duration: brokecolors ? 1000 : 0 ; easing.type: Easing.Linear; }
    ColorAnimation { target: thefirstword; property: "styleColor" ; to: "#00000000";duration: brokecolors ? 1000 : 0 ; easing.type: Easing.Linear; }
    ColorAnimation { target: thesecondword; property: "color" ; to: second_word_color;duration: brokecolors ? 1000 : 0 ; easing.type: Easing.Linear; }
    ColorAnimation { target: thesecondword; property: "styleColor" ; to: "#00000000";duration: brokecolors ? 1000 : 0 ; easing.type: Easing.Linear; }

    }

    ScriptAction{script: change_background_on_gameover.start(); }


    SequentialAnimation {


    NumberAnimation { target: card; duration: 15 ; property: "rotation"; to: 8 ; }
    NumberAnimation { target: card; property: "x"; to: theX+30 ; duration: 40 ; easing.period: 1.1; easing.amplitude: 1.1; easing.type: Easing.OutInQuart; }
    NumberAnimation { target: card; duration: 15 ; property: "rotation"; to: -8 ; }
    NumberAnimation { target: card; property: "x"; to: theX-30 ; duration: 40 ; easing.period: 1.1; easing.amplitude: 1.1; easing.type: Easing.OutInQuart; }
    NumberAnimation { target: card; duration: 15 ; property: "rotation"; to: 4 ; }
    NumberAnimation { target: card; property: "x"; to: theX+20 ; duration: 45 ; easing.period: 1.1; easing.amplitude: 1.1; easing.type: Easing.OutInQuart; }
    NumberAnimation { target: card; duration: 15 ; property: "rotation"; to: -4 ; }
    NumberAnimation { target: card; property: "x"; to: theX-20; duration: 45 ; easing.period: 1.1; easing.amplitude: 1.1; easing.type: Easing.OutInQuart; }
    NumberAnimation { target: card; duration: 15 ; property: "rotation"; to: 2 ; }
    NumberAnimation { target: card; property: "x"; to: theX+10 ; duration: 45 ; easing.period: 1.1; easing.amplitude: 1.1; easing.type: Easing.OutInQuart; }
    NumberAnimation { target: card; duration: 15 ; property: "rotation"; to: -2 ; }
    NumberAnimation { target: card; property: "x"; to: theX-10 ; duration: 45 ; easing.period: 1.1; easing.amplitude: 1.1; easing.type: Easing.OutInQuart; }
    NumberAnimation { target: card; duration: 15 ; property: "rotation"; to: 0 ; }
    NumberAnimation { target: card; property: "x"; to: theX ; duration: 80 ; easing.period: 1.1; easing.amplitude: 2.1; easing.type: Easing.OutInQuart; }
    PauseAnimation { duration: 600 }


    }

    onStopped: {

    audioManager.play(66)
    card_animations.correciton_animation.start()
    }


    }