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

   Opponents {
     id: opponentSnowman1
     z: -1
     anchors {
       top: scene.top
       left: scene.left
       topMargin: scene.height / 6 - height / 2
       leftMargin: scene.width / 6 - width / 2
     }
     rotation: 0
     opponentBody.source: Qt.resolvedUrl("../../assets/img/Snowman.gif")
   }

   Opponents {
     id: opponentSnowman2
     z: -1
     anchors {
       top: scene.top
       left: scene.left
       topMargin: scene.height / 6 - height / 2
       leftMargin: scene.width / 6 * 5 - width / 2
     }
     rotation: 0
     opponentBody.source: Qt.resolvedUrl("../../assets/img/Snowman.gif")
   }

   Opponents {
     id: opponentSnowman3
     z: -1
     anchors {
       top: scene.top
       left: scene.left
       topMargin: scene.height / 6 * 5 - height / 2
       leftMargin: scene.width / 6 - width / 2
     }
     rotation: 0
     opponentBody.source: Qt.resolvedUrl("../../assets/img/Snowman.gif")
   }

   Opponents {
     id: opponentSnowman4
     z: -1
     anchors {
       top: scene.top
       left: scene.left
       topMargin: scene.height / 6 * 5 - height / 2
       leftMargin: scene.width / 6 * 5 - width / 2
     }
     rotation: 0
     opponentBody.source: Qt.resolvedUrl("../../assets/img/Snowman.gif")
   }

   // trees: vertical line of 3 trees on left side, same on right side
   Tree {
     entityId: "tree1"
     id: tree1
     anchors {
       top: scene.top
       left: scene.left
       topMargin: scene.height / 4 - height / 2
       leftMargin: scene.width / 3 - width / 2
     }
     treeBody.source: Qt.resolvedUrl("../../assets/img/Tree.png")
   }

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

   Tree {
     entityId: "tree3"
     id: tree3
     anchors {
       top: scene.top
       left: scene.left
       topMargin: scene.height / 4 * 3 - height / 2
       leftMargin: scene.width / 3 - width / 2
     }
     treeBody.source: Qt.resolvedUrl("../../assets/img/Tree.png")
   }

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

   Tree {
     entityId: "tree5"
     id: tree5
     anchors {
       top: scene.top
       left: scene.left
       topMargin: scene.height / 4 * 2 - height / 2
       leftMargin: scene.width / 3 * 2 - width / 2
     }
     treeBody.source: Qt.resolvedUrl("../../assets/img/Tree.png")
   }

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

   Tree {
     entityId: "tree7"
     id: tree7
     anchors {
       top: scene.top
       left: scene.left
       topMargin: scene.height / 7 * 3 - height / 2 - 25
       leftMargin: scene.width / 5 - width / 2
     }
     treeBody.source: Qt.resolvedUrl("../../assets/img/Tree.png")
   }

   Tree {
     entityId: "tree8"
     id: tree8
     anchors {
       top: scene.top
       left: scene.left
       topMargin: scene.height / 7 * 5 - height / 2 - 45
       leftMargin: scene.width / 5 - width / 2
     }
     treeBody.source: Qt.resolvedUrl("../../assets/img/Tree.png")
   }

   Tree {
     entityId: "tree9"
     id: tree9
     anchors {
       top: scene.top
       left: scene.left
       topMargin: scene.height / 7 * 3 - height / 2 - 25
       leftMargin: scene.width / 5 * 4 - width / 2
     }
     treeBody.source: Qt.resolvedUrl("../../assets/img/Tree.png")
   }

   Tree {
     entityId: "tree10"
     id: tree10
     anchors {
       top: scene.top
       left: scene.left
       topMargin: scene.height / 7 * 5 - height / 2 - 45
       leftMargin: scene.width / 5 * 4 - width / 2
     }
     treeBody.source: Qt.resolvedUrl("../../assets/img/Tree.png")
   }

   // horizontal centered PowerUpSpawns, two in upper half, two in lower half
   PowerUpSpawn {
     entityId: "spawn1"
     id: spawn1
     anchors {
       top: scene.top
       left: scene.left
       topMargin: scene.height / 5 - height / 2
       leftMargin: scene.width / 2 - width / 2
     }
     spawnBody.source: Qt.resolvedUrl("../../assets/img/PUSpawn.png")
   }

   PowerUpSpawn {
     entityId: "spawn2"
     id: spawn2
     anchors {
       top: scene.top
       left: scene.left
       topMargin: scene.height / 5 * 2 - height / 2
       leftMargin: scene.width / 2 - width / 2
     }
     spawnBody.source: Qt.resolvedUrl("../../assets/img/PUSpawn.png")
   }

   PowerUpSpawn {
     entityId: "spawn3"
     id: spawn3
     anchors {
       top: scene.top
       left: scene.left
       topMargin: scene.height / 5 * 3 - height / 2
       leftMargin: scene.width / 2 - width / 2
     }
     spawnBody.source: Qt.resolvedUrl("../../assets/img/PUSpawn.png")
   }

   PowerUpSpawn {
     entityId: "spawn4"
     id: spawn4
     anchors {
       top: scene.top
       left: scene.left
       topMargin: scene.height / 5 * 4 - height / 2
       leftMargin: scene.width / 2 - width / 2
     }
Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded