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

Durdles - 2-Player Action Game

 import QtQuick 2.0
 import Felgo 4.0
 import "../common" as Common
 import ".."
 import "../levels"
 import "../entities"
 import "../entities/powerUps"

 Common.LevelBase {
   id: scene

   // plant a little forest in the middle
   // from left to right
   Tree {
     entityId: "tree5"
     id: tree5
     z: -1
     anchors {
       top: scene.top
       left: scene.left
       topMargin: scene.height / 2 -5
       leftMargin: tree5.treeBody.width - 18
     }
     treeBody.source: Qt.resolvedUrl("../../assets/img/Tree.png")
     onEnabledChanged: GameInfo.testLevel = true
   }

   Tree {
     entityId: "tree2"
     id: tree2
     z: -1
     anchors {
       top: scene.top
       left: scene.left
       topMargin: scene.height / 2 - 15
       leftMargin: scene.width / 2 - tree2.treeBody.width * 1.6
     }
     treeBody.source: Qt.resolvedUrl("../../assets/img/Tree.png")
   }

   Tree {
     entityId: "tree1"
     id: tree1
     z: -1
     anchors {
       top: scene.top
       left: scene.left
       topMargin: scene.height / 2 + 5
       leftMargin: scene.width / 2 - tree1.treeBody.width
     }
     treeBody.source: Qt.resolvedUrl("../../assets/img/Tree.png")
   }

   Tree {
     entityId: "tree3"
     id: tree3
     z: -1
     anchors {
       top: scene.top
       left: scene.left
       topMargin: scene.height / 2 - 15
       leftMargin: scene.width / 2 + 10
     }
     treeBody.source: Qt.resolvedUrl("../../assets/img/Tree.png")
   }

   Tree {
     entityId: "tree4"
     id: tree4
     z: -1
     anchors {
       top: scene.top
       left: scene.left
       topMargin: scene.height / 2 + 15
       leftMargin: scene.width / 2 + tree4.treeBody.width * 2
     }
     treeBody.source: Qt.resolvedUrl("../../assets/img/Tree.png")
   }

   Tree {
     entityId: "tree7"
     id: tree7
     z: -1
     anchors {
       top: scene.top
       left: scene.left
       topMargin: scene.height / 2 - 4
       leftMargin: scene.width - tree6.treeBody.width + 18 - tree7.treeBody.width  + 18
     }
     treeBody.source: Qt.resolvedUrl("../../assets/img/Tree.png")
   }

   Tree {
     entityId: "tree6"
     id: tree6
     z: -1
     anchors {
       top: scene.top
       left: scene.left
       topMargin: scene.height / 2 + 19
       leftMargin: scene.width - tree6.treeBody.width + 18
     }
     treeBody.source: Qt.resolvedUrl("../../assets/img/Tree.png")
   }

   PowerUpAccelerator {
     id: powAccelerator
     z: -1
     anchors {
       top: scene.top
       left: scene.left
       topMargin: scene.height / 3 - height / 2
       leftMargin: scene.width/5*3 + 5
     }
   }

   PowerUpLifeUp {
     id: powLifeUp
     z: -1
     anchors {
       top: scene.top
       left: scene.left
       topMargin: scene.height / 3 - height / 2
       leftMargin: scene.width / 3 - width / 2 + 5
     }
   }

   PowerUpPowershot {
     id: poPowershot
     z: -1
     anchors {
       top: scene.top
       left: scene.left
       topMargin: scene.height/3*2 - height/2
       leftMargin: scene.width/3 - width/2 + 5
     }
   }

   PowerUpShield {
     id: powShield
     z: -1
     anchors {
       top: scene.top
       left: scene.left
       topMargin: scene.height/3*2 - height/2
       leftMargin: scene.width/5*3 + 5
     }
   }

   // tutorial hints
   Text {
     z: -2
     opacity: 0.5
     id: energy
     text: "Energy"
     color: "#54A4BF"
     font.family: standardFont.name
     font.pixelSize: 16
     anchors {
       top: parent.top
       topMargin: 130
       left: parent.left
       leftMargin: 90
     }
   }

   Text {
     z: -2
     opacity: 0.5
     id: speed
     text: "Speed"
     color: "#54A4BF"
     font.family: standardFont.name
     font.pixelSize: 16
     anchors {
       top: parent.top
       topMargin: 130
       left: parent.left
       leftMargin: 190
     }
   }

   Text {
     z: -2
     opacity: 0.5
     id: power
     text: "Power"
     color: "#54A4BF"
     font.family: standardFont.name
     font.pixelSize: 16
     anchors {
       top: parent.top
       topMargin: 290
       left: parent.left
       leftMargin: 90
     }
   }

   Text {
     z: -2
     opacity: 0.5
     id: shield
     text: "Shield"
     color: "#54A4BF"
     font.family: standardFont.name
     font.pixelSize: 16
     anchors {
       top: parent.top
       topMargin: 290
       left: parent.left
       leftMargin: 190
Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded