Flappy Bird Game
import QtQuick 2.0
import Felgo 4.0
import "../common"
SceneBase {
id: scene
property alias gameNetwork: gameNetwork
property alias initialStateBeforeShow: gameNetworkView.initialStateBeforeShow
GameNetworkView {
id: gameNetworkView
anchors.fill: scene.gameWindowAnchorItem
showAchievementsHeaderIcon: false
onBackClicked: {
scene.backButtonPressed()
}
}
FelgoGameNetwork {
id: gameNetwork
gameId: 105
secret: "flappyBirdDevPasswordForVPlayGameNetwork"
gameNetworkView: gameNetworkView
onNewHighscore: {
if(!isUserNameSet(userName)) {
NativeUtils.displayTextInput("Congratulations!", "You achieved a new highscore. What is your player name for comparing your scores?", "")
}
}
}
Connections {
target: NativeUtils
function onTextInputFinished(accepted, enteredText) {
if(accepted) {
var validUserName = gameNetwork.updateUserName(enteredText)
}