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

Juicy Squash - Match-3 Game

 import Felgo 4.0
 import QtQuick 2.0
 import QtMultimedia 5.0

 Item {
   id: gameSound

   // game sound effects
   GameSoundEffect {
     id: moveBlock
     source: Qt.resolvedUrl("../../assets/snd/NFF-switchy.wav")
   }

   GameSoundEffect {
     id: moveBlockBack
     source: Qt.resolvedUrl("../../assets/snd/NFF-switchy-02.wav")
   }

   GameSoundEffect {
     id: fruitClear
     source: Qt.resolvedUrl("../../assets/snd/NFF-fruit-collected.wav")
   }

   GameSoundEffect {
     id: overloadClear
     source: Qt.resolvedUrl("../../assets/snd/NFF-fruit-appearance.wav")
   }

   GameSoundEffect {
     id: upgrade
     source: Qt.resolvedUrl("../../assets/snd/NFF-upgrade.wav")
   }

   // text (overlay) audios
   GameSoundEffect {
     id: overloadSound
     autoPlay: false
     source: Qt.resolvedUrl("../../assets/snd/texts/JuicyOverload.wav")
   }

   GameSoundEffect {
     id: fruitySound
     autoPlay: false
     source: Qt.resolvedUrl("../../assets/snd/texts/Fruity.wav")
   }

   GameSoundEffect {
     id: sweetSound
     autoPlay: false
     source: Qt.resolvedUrl("../../assets/snd/texts/Sweet.wav")
   }

   GameSoundEffect {
     id: refreshingSound
     autoPlay: false
     source: Qt.resolvedUrl("../../assets/snd/texts/Refreshing.wav")
   }

   GameSoundEffect {
     id: yummySound
     autoPlay: false
     source: Qt.resolvedUrl("../../assets/snd/texts/Yummy.wav")
   }

   GameSoundEffect {
     id: deliciousSound
     autoPlay: false
     source: Qt.resolvedUrl("../../assets/snd/texts/Delicious.wav")
   }

   GameSoundEffect {
     id: smoothSound
     autoPlay: false
     source: Qt.resolvedUrl("../../assets/snd/texts/Smooth.wav")
   }

   // functions to play sounds
   function playMoveBlock() { moveBlock.stop(); moveBlock.play() }
   function playMoveBlockBack() { moveBlock.stop(); moveBlockBack.play() }
   function playFruitClear() { fruitClear.stop(); fruitClear.play() }
   function playOverloadClear() {  overloadClear.stop(); overloadClear.play() }
   function playUpgrade() { upgrade.stop(); upgrade.play() }

   function playFruitySound() {  fruitySound.stop(); fruitySound.play() }
   function playSweetSound() {  sweetSound.stop(); sweetSound.play() }
   function playRefreshingSound() {  refreshingSound.stop(); refreshingSound.play() }
   function playOverloadSound() {  overloadSound.stop(); overloadSound.play() }
   function playYummySound() {  yummySound.stop(); yummySound.play() }
Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded