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

Stack With Friends Demo

 import Felgo 3.0
 import QtQuick 2.0
 import QtMultimedia 5.0

 Item {
   id: audioManager

   property int idSPAWN: 11
   property int idGAMEOVER: 22

   property bool toggleSPAWN

   function play(clipID) {
     // if settings disable do not play sounds
     if(!settings.soundEnabled)
       return

     switch(clipID) {
     case idSPAWN:
       if(toggleSPAWN) clipSPAWN_1.play()
       else clipSPAWN_2.play()
       toggleSPAWN = !toggleSPAWN
       break
     case idGAMEOVER:
       clipGAMEOVER.play()
       break
     }
   }

   Audio {
     id: clipSPAWN_1
     source: "../../assets/snd/spawn.wav"
     volume: 1
   }
   Audio {
     id: clipSPAWN_2
     source: "../../assets/snd/spawn.wav"
     volume: 1
   }
   Audio {
     id: clipGAMEOVER
     source: "../../assets/snd/gameover.wav"
Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded