ChickenOutbreak2 Demo
import QtQuick 2.0
import Felgo 4.0
GameWindow {
id: window
screenWidth: 640
screenHeight: 960
property bool developerBuild: !system.publishBuild
property int maximumHighscore: 0
onMaximumHighscoreChanged: {
if(implLoader.item) implLoader.item.maximumHighscoreChanged()
}
AudioManager {
id: audioManager
}
FontLoader {
id: fontHUD
source: Qt.resolvedUrl("fonts/rodeo.ttf")
}
Flurry {
id: flurry
apiKey: ""
}
ChartboostView {
id: chartboostView
}
Facebook {
id: facebook
appId: "583338428422091"
readPermissions: ["email", "read_friendlists"]
publishPermissions: ["publish_actions"]
}
Component.onCompleted: {
if(!developerBuild) {
system.logOutputEnabled = false
}
if(!system.isPlatform(System.IOS)) {
splashLoader.source = "SplashScreen.qml"
} else {
implLoader.source = "ChickenOutbreak2MainItem.qml"
}
}
state: "main"
Timer {
id: splashScreenOff
interval: 1000
onTriggered: {
if(splashLoader.item) {
splashLoader.item.exitScene()
}
}
}
Timer {
id: startLoading
interval: 1000
onTriggered: {
implLoader.source = "ChickenOutbreak2MainItem.qml"
}
}
Connections {
target: splashLoader.item ? splashLoader.item : null
function onLoadingFinished() {
if(implLoader.item) {
implLoader.item.activateMain()
}
splashLoader.source = ""
}
}
Loader {
id: splashLoader
onLoaded: {
if(item) {
item.enterScene()
}
startLoading.start()
}
}
Loader {
id: implLoader
onLoaded: {
if(item) {
splashScreenOff.start()
if(implLoader.item && system.isPlatform(System.IOS)) {
implLoader.item.activateMain()
}
}
}
}
onStateChanged: {
if(implLoader.item) implLoader.item.state = state
}
onApplicationPaused: {