Find the Best Demos and Examples

Check out this quick tour to find the best demos and examples for you, and to see how the Felgo SDK can help you to develop your next app or game!

GameNetworkExample

 import Felgo 3.0
 import QtQuick 2.0

 TestBase {

   property string currentAchievementKey: "achievement01"

   // can either be "achievementKey" or ""
   property string textInputState

  Column {

   Text {
     text: "currentAchievementKey: " + currentAchievementKey
     color: "white"
   }

   SimpleButton {
     text: "Change Current Achievement"
     onClicked: {
       textInputState = "achievementKey"
       nativeUtils.displayTextInput("Enter Achievement Key", "", "", currentAchievementKey )
     }
   }

   SimpleButton {
     text: "Increase Achievement progress"
     onClicked: {
       gameNetwork.incrementAchievement(currentAchievementKey)
     }
   }
   SimpleButton {
     text: "Unlock Achievement"
     onClicked: {
       gameNetwork.unlockAchievement(currentAchievementKey)
     }
   }
   SimpleButton {
     text: "Get All Achievements"
     onClicked: {
       gameNetwork.api.getAllAchievements()
     }
   }
   SimpleButton {
     text: "Get User Achievements with progress"
     onClicked: {
       gameNetwork.api.getAchievementProgress()
     }
   }

   /* Resetting achievement is not supported by the API yet!
   SimpleButton {
     text: "Reset Achievement"
     onClicked: {
       gameNetwork.resetAchievement(currentAchievementKey)
     }
   }
   */

   SimpleButton {
     text: "Show AchievementView"
     onClicked: {
       gameNetwork.showAchievements()
     }
   }

  }// Column

   Connections {
     target: nativeUtils
     onTextInputFinished: {

       if(textInputState === "achievementKey" && accepted) {
         currentAchievementKey = enteredText
       }

       textInputState = ""
     }