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

 SceneBase {
   id: scene

   property alias gameNetwork: gameNetwork

   GameNetworkView {
     id: gameNetworkView
     anchors.fill: scene.gameWindowAnchorItem

     // no achievements used yet, so do not show the achievements icon
     showAchievementsHeaderIcon: false

     onBackClicked: {
       scene.backButtonPressed()
     }
   }

   FelgoGameNetwork {
     id: gameNetwork
     // received from the GameNetwork dashboard at https://cloud.felgo.com
     gameId: 168
     secret: "juicySquashDevPasswordForVPlayGameNetwork"
     gameNetworkView: gameNetworkView

     onNewHighscore: {
       if(!isUserNameSet(userName)) {
         NativeUtils.displayTextInput("Congratulations!", "You achieved a new highscore. What is your player name for comparing your juicy scores?", "")
       }
       else {
         NativeUtils.displayMessageBox("Congratulations!", "You achieved a new highscore of "+gameScene.score+" points.", 1)
       }
     }
   }

   Connections {
     target: NativeUtils
     function onTextInputFinished(accepted, enteredText) {
       if(accepted) {
         var validUserName = gameNetwork.updateUserName(enteredText)
       }
Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded