CreditsSceneDecoration.qml Example File

demos/ChickenOutbreak2/qml/CreditsSceneDecoration.qml
 import QtQuick 2.0
 import Felgo 3.0

 Item {

   Component.onCompleted: {
     fallingHen1.x = Math.random() * creditsScene.width
     fallingHen2.x = Math.random() * creditsScene.width
   }

   Item {
     id: fallingHen1
     y: -90

     Image {
       source: store.blackHen.purchased ? "../assets/chicken2-front.png" : "../assets/chicken4-front.png"
       width: 30
       height: 30
     }

     onYChanged: {
       if(y >= creditsScene.height + 85) x = Math.random() * creditsScene.width
     }
   }

   PropertyAnimation {
     id: falling1
     target: fallingHen1
     properties: "y"
     to: creditsScene.height + 90
     duration: 1000
     running: true
     loops: Animation.Infinite
   }

   Item {
     id: fallingHen2
     y: -90

     Image {
       source: store.blackHen.purchased ? "../assets/chicken2-front.png" : "../assets/chicken4-front.png"
       width: 30
       height: 30
     }

     onYChanged: {
       if(y >= creditsScene.height + 85) x = Math.random() * creditsScene.width
     }
   }

   PropertyAnimation {
     id: falling
     target: fallingHen2
     properties: "y"
     to: creditsScene.height + 90
     duration: 2400
     running: true
     loops: Animation.Infinite
   }
 }

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support