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 bool textInputForLeaderboardInput: false

  Column {
   SimpleButton {
     text: "Report Higher Score: " + (highscore+1).toString()
     onClicked: {
       gameNetwork.reportScore(highscore+1)
       // the highscore is no modified by the GameNetwork!
       // until the reading of the highscore is implemented increase the score here
       //highscore++
     }
   }

   SimpleButton {
     text: "Get User Score"
     onClicked: {
       gameNetwork.api.getUserScore()
     }
   }

   SimpleButton {
     text: "Get Leaderboard Scores"
     onClicked: {
       gameNetwork.api.getLeaderboardScores()
     }
   }

   SimpleButton {
     text: "Change Leaderboard"
     onClicked: {
       textInputForLeaderboardInput = true
       nativeUtils.displayTextInput("Enter Leaderboard", "", "", gameNetwork.currentActiveLeaderboard)

     }
   }

   Connections {
     target: nativeUtils
     onTextInputFinished: {

       if(textInputForLeaderboardInput && accepted) {
         gameNetwork.currentActiveLeaderboard = enteredText
       }
       textInputForLeaderboardInput = false
     }
   }

   SimpleButton {
     text: "Show Leaderboard"
     onClicked: {
       gameNetwork.showLeaderboard()
     }
   }

   SimpleButton {
     text: "Report Slider Score " + Math.round(scoreSlider.value)
     onClicked: {
       gameNetwork.reportScore(Math.round(scoreSlider.value))
     }
   }

   SimpleButton {
     text: "Report Relative Slider Score " + Math.round(scoreSlider.value)
     onClicked: {
       gameNetwork.reportRelativeScore(Math.round(scoreSlider.value))
     }
   }

   GameSlider {
     id: scoreSlider
     minimumValue: -100
     maximumValue: 100
     value: 10
     width: 200
     height: 20
   }

   Text {
     text: "highscore: " + highscore + "\ncurrentLB: " + gameNetwork.currentActiveLeaderboard
     color: "white"