Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Crazy Carousel Game

 import QtQuick 2.0
 import Felgo 4.0

 EntityBase {
     id: rideFront
     entityType: "rideFront"

     z: 9

     property alias image: image
     property alias minY: upDownMovement.minPropertyValue
     property alias maxY: upDownMovement.maxPropertyValue
     property alias velocity: upDownMovement.velocity
     property double speed: 10 * gameScene.logic.speedUp

     MultiResolutionImage {
         id: image
         width: parent.width
         height: parent.height

     // provides up/down movement
     MovementAnimation {
         id: upDownMovement
         target: rideFront
         property: "y"
         velocity: -rideFront.speed // start with up movement
         running: true

         // change direction after min/max is reached
         onLimitReached: {
             if(rideFront.velocity > 0)
                 rideFront.velocity = -rideFront.speed
                 rideFront.velocity = rideFront.speed
Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded