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

Durdles - 2-Player Action Game

 import Felgo 4.0
 import QtQuick 2.0
 import QtMultimedia 5.0
 import "../common"
 import ".."

 // scene with the main menu
 SceneBase {
   id: menuScene

   // signal indicating that the selectLevelScene should be displayed
   signal selectLevelPressed
   // signal indicating that the creditsScene should be displayed
   signal creditsPressed
   // signal indicating that the settingScene should be displayed
   signal settingsPressed

   //property alias ambienceMusic: ambienceMusic

   // play background music
 //  BackgroundMusic {
 //    loops: SoundEffect.Infinite
 //    volume: 0.35
 //    id: ambienceMusic
 //    // an ogg file is not playable on windows, because the extension is not supported!
 //    source: Qt.resolvedUrl("../../assets/snd/BG.mp3")
 //  }

   // timer plays the background music
   Timer {
     id: timerMusic
     interval: 100; running: true; repeat: true;
     onTriggered: {
       //ambienceMusic.play()
       running = false
     }
   }

   // background
   Image {
     z: -2
     id: background
     source: Qt.resolvedUrl("../../assets/img/MenuBG.png")

     // use this if the image should be centered, which is the most common case
     // if the image should be aligned at the bottom, probably the whole scene should be aligned at the bottom, and the image should be shited up by the delta between the imagesSize and the scene.y!
     anchors.centerIn: parent
     scale: 0.5
   }

   // switch to level selection scene
   MenuButton {
     id: menuButton1
     anchors.top: parent.top
     anchors.left: parent.left
     anchors.topMargin: 230
     anchors.leftMargin: 175
     rotation: 352
     text: "Play"
     onClicked: selectLevelPressed()
     color: "transparent"
     buttonText.color: "white"
     buttonText.opacity: 1
     buttonText.font.pixelSize: 36
     buttonText.font.family: standardFont.name
   }

   // switch to settings scene
   MenuButton {
     anchors.top: parent.top
     anchors.left: parent.left
     anchors.topMargin: 314
     anchors.leftMargin: 175
     rotation: 352
     text: "Settings"
     onClicked: settingsPressed()
     color: "transparent"
     buttonText.color: "white"
     buttonText.opacity: 1
     buttonText.font.pixelSize: 36
     buttonText.font.family: standardFont.name
   }

   // switch to credits scene
   MenuButton {
     anchors.top: parent.top
     anchors.left: parent.left
     anchors.topMargin: 398
     anchors.leftMargin: 178
     rotation: 352
     text: "Credits"
     onClicked: creditsPressed()
     color: "transparent"
     buttonText.color: "white"
     buttonText.opacity: 1
     buttonText.font.pixelSize: 36
Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded