Skip to content

Instantly share code, notes, and snippets.

@wertgit
Forked from anonymous/shake.qml
Created January 20, 2017 05:13
Show Gist options
  • Save wertgit/ea3b9f68e52aa054f0b1cb7aec497ed1 to your computer and use it in GitHub Desktop.
Save wertgit/ea3b9f68e52aa054f0b1cb7aec497ed1 to your computer and use it in GitHub Desktop.
Card Shake
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()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment