Skip to content

Instantly share code, notes, and snippets.

@clock21am
Created April 4, 2016 12:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clock21am/46aa51f3e038c1554e63f1cc1b5ebdb7 to your computer and use it in GitHub Desktop.
Save clock21am/46aa51f3e038c1554e63f1cc1b5ebdb7 to your computer and use it in GitHub Desktop.
State {
name:"backedge"
PropertyChanges {
target: tux
visible:false
y:tux.y
x:tux.x-10
}
},
State {
name: "relaxatintal"
PropertyChanges {
target: tux
visible:false
y:tux.y
x:tux.width/3
}
},
State {
name: "initaledge"
PropertyChanges {
target: tux
visible:false
y:tux.y
x:tux.x-10
}
},
State {
name: "relaxatback"
PropertyChanges {
target: tux
visible:false
y:tux.y
x:background.width-(tux.width/2)
}
}
]
transitions: [
Transition {
from: "backedge"
to: "relaxatintal"
NumberAnimation { properties:"x"; duration:10 }
onRunningChanged: {
if((Activity.flagoutboundry === 2)&&(tux.x===(tux.width/3))&&
(tux.state==="backedge"||tux.state==="relaxatintal")) {
Activity.flagoutboundry = 1
tux.visible = true;
velocityX = Activity.velocityX
if(Activity.tuxImageStatus ===1) {
tux.state="Released"
} else if(Activity.tuxImageStatus === 2) {
tux.state="Released1"
}
}
}
},
Transition {
from: "initaledge"
to: "relaxatback"
NumberAnimation { properties:"x"; duration:10 }
onRunningChanged: {
if((Activity.flaginboundry === 2)&&(tux.x > background.width-(tux.width/1.5))&&
(Activity.flagoutboundry!=2)&&(tux.state==="initaledge"||tux.state==="relaxatback")) {
Activity.flaginboundry = 1;
tux.visible = true;
velocityX = Activity.velocityX
if(Activity.tuxImageStatus ===1) {
tux.state = "Released"
} else if(Activity.tuxImageStatus === 2) {
tux.state = "Released1"
}
}
}
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment