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

ChickenOutbreak2 Demo

 import Felgo 3.0
 import QtQuick 2.0
 import QtMultimedia 5.0

 Item {
   id: audioManager

   // Use Sound IDs to play Sounds e.g. audioManager.play(audioManager.idBADCORN)
   property int idBADCORN: 11
   property int idCORN: 22
   property int idGAMEOVER: 33
   property int idMENUCLICK: 44
   property int idPARACHUTE: 55
   property int idPLING: 66
   property int idPOWERUP: 77
   property int idSLOWMO: 88
   property int idSLOWMOOFF: 99
   property int idTELEPORT: 111
   property int idTICK: 222

   property bool toggleCORN

   // Use Music IDs to play Music. e.g. audioManager.playMusic(audioManager.idMusicBG)
   property int idMusicBG: 111

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

     switch(clipID) {
     case idBADCORN:
       clipBADCORN.play()
       break
     case idCORN:
       if(toggleCORN) clipCORN_1.play()
       else clipCORN_2.play()
       toggleCORN = !toggleCORN
       break
     case idGAMEOVER:
       clipGAMEOVER.play()
       break
     case idMENUCLICK:
       clipMENUCLICK.play()
       break
     case idPARACHUTE:
       clipPARACHUTE.play()
       break
     case idPLING:
       clipPLING.play()
       break
     case idPOWERUP:
       clipPOWERUP.play()
       break
     case idSLOWMO:
       clipSLOWMO.play()
       break
     case idSLOWMOOFF:
       clipSLOWMOOFF.play()
       break
     case idTELEPORT:
       clipTELEPORT.play()
       break
     case idTICK:
       clipTICK.play()
       break
     }
   }

   function playMusic(trackID) {
     // if settings disable do not play sounds
     if(!settings.musicEnabled)
       return

     switch(trackID) {
     case idMusicBG:
       music.source = "../assets/snd/bg-new.wav"
       break
     }

     music.play()
   }

   function stopMusic() {
     music.stop()
   }

   BackgroundMusic {
     id: music
   }

   Audio {
     id: clipBADCORN
     source: "../assets/snd/badCoin.wav"
     volume: 1
   }
   Audio {
     id: clipCORN_1
     source: "../assets/snd/corn.wav"
     volume: 1
   }
   Audio {
     id: clipCORN_2
     source: "../assets/snd/corn.wav"
     volume: 1
   }
   Audio {
     id: clipGAMEOVER
     source: "../assets/snd/gameOver.wav"
     volume: 1
   }
   Audio {
     id: clipMENUCLICK
     source: "../assets/snd/menuclick.wav"
     volume: 1
   }
   Audio {
     id: clipPARACHUTE
     source: "../assets/snd/parachute.wav"
     volume: 1
   }
   Audio {
     id: clipPLING
     source: "../assets/snd/pling.wav"
     volume: 1
   }
   Audio {
     id: clipPOWERUP
     source: "../assets/snd/powerup.wav"
     volume: 1
   }
   Audio {
     id: clipSLOWMO
     source: "../assets/snd/SlowMo.wav"
     volume: 1
   }
   Audio {
     id: clipSLOWMOOFF
     source: "../assets/snd/SlowMoOut.wav"
     volume: 1
   }
   Audio {
     id: clipTELEPORT
     source: "../assets/snd/teleport.wav"
     volume: 1
   }
   Audio {
     id: clipTICK
     source: "../assets/snd/tick.wav"
     volume: 1
   }

   Component.onCompleted: {
Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded