ChickenOutbreak2 Demo
import QtQuick 2.0
import Felgo 4.0
SceneBase {
property int slideNum : 1
signal finished
Component.onCompleted: opacity = 1
onBackButtonPressed: {
audioManager.play(audioManager.idMENUCLICK)
if(slideNum > 1) {
slideNum--
} else {
if(windowMainItem.lastState === "gameOver") {
window.state = "gameOver"
} else {
window.state = "main"
}
}
}
MultiResolutionImage {
source: Qt.resolvedUrl("../assets/background-wood2.png")
anchors.centerIn: parent
}
Image {
source: Qt.resolvedUrl("../assets/sign.png")
anchors.horizontalCenter: parent.horizontalCenter
y: -110
width: 230
height: 200
z: 10
}
Image {
source: Qt.resolvedUrl("../assets/sign.png")
anchors.horizontalCenter: parent.horizontalCenter
y: 10
width: 210
height: 170
z: 9
mirror: true
}
Image {
source: Qt.resolvedUrl("../assets/sign.png")
anchors.horizontalCenter: parent.horizontalCenter
y: 115
width: 210
height: 170
z: 8
}
Image {
source: Qt.resolvedUrl("../assets/sign.png")
visible: slideNum === 2
anchors.horizontalCenter: parent.horizontalCenter
y: 220
width: 210
height: 170
z: 7
mirror: true
}
MenuButton {
anchors.bottom: parent.bottom
anchors.bottomMargin: 20
anchors.horizontalCenter: parent.horizontalCenter
height: 40
text: qsTr("Continue")
onClicked: nextSlide()
}
Item {
z: 15
visible: slideNum === 1
width: parent.width
height: parent.height
Image {
source: Qt.resolvedUrl("../assets/parachute.png")
anchors.verticalCenter: parachuteTitle.verticalCenter
anchors.right: parachuteTitle.left
anchors.rightMargin: 10
width: 40
height: 40
}
MenuText {
id: parachuteTitle
text: qsTr("Parachute")
y: 24
anchors.horizontalCenter: parent.horizontalCenter
font.pixelSize: 34
rotation: -2
}
MenuText {
id: startPar
y: 126
text: qsTr("Start parachute")
rotation: 2
font.pixelSize: 25
anchors.horizontalCenter: system.desktopPlatform ? undefined : parent.horizontalCenter
x: system.desktopPlatform ? 135 : 0
}
Image {
source: system.desktopPlatform ? "../assets/button_space.png" : "../assets/touch.png"
anchors.verticalCenter: startPar.verticalCenter
anchors.right: startPar.left
anchors.rightMargin: 5
width: system.desktopPlatform ? 50 : 30
height: system.desktopPlatform ? 96 : 57
}
MenuText {
id: stopPar
y: 234
text: qsTr("Stop parachute")
rotation: -2
font.pixelSize: 25
anchors.horizontalCenter: system.desktopPlatform ? undefined : parent.horizontalCenter
x: system.desktopPlatform ? 135 : 0
}
Image {
source: system.desktopPlatform ? "../assets/button_space.png" : "../assets/touch.png"
anchors.verticalCenter: stopPar.verticalCenter
anchors.right: stopPar.left
anchors.rightMargin: 5
width: system.desktopPlatform ? 50 : 30
height: system.desktopPlatform ? 96 : 57
}
}
Item {
z: 15
visible: slideNum === 2
width: parent.width
height: parent.height
Image {
source: Qt.resolvedUrl("../assets/teleport.png")
anchors.verticalCenter: teleportTitle.verticalCenter
anchors.right: teleportTitle.left
anchors.rightMargin: 10
width: 50
height: 40
}
MenuText {
id: teleportTitle
y: 24
anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("Teleport")
font.pixelSize: 34
rotation: -2
}
MenuText {
id: stopTime
visible: slideNum === 2
y: 126
anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("Stop time")
rotation: 2
font.pixelSize: 25
}
Image {
source: system.desktopPlatform ? "../assets/button_up.png" : "../assets/swipe_up.png"
anchors.verticalCenter: stopTime.verticalCenter
anchors.right: stopTime.left
anchors.rightMargin: 5
width: 30
height: 57
}
MenuText {
id: tpToDest
y: 237
anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("Teleport to destination")
rotation: -2
font.pixelSize: 20
}
Image {
source: system.desktopPlatform ? "../assets/click.png" : "../assets/touch.png"
anchors.verticalCenter: tpToDest.verticalCenter
anchors.right: tpToDest.left
anchors.rightMargin: 5
width: 30
height: 57
}
MenuText {
id: resumeTime
y: 336
anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("Resume time")
rotation: 2
font.pixelSize: 25
}
Image {
source: system.desktopPlatform ? "../assets/button_down.png" : "../assets/swipe_down.png"
anchors.verticalCenter: resumeTime.verticalCenter
anchors.right: resumeTime.left
anchors.rightMargin: 5
width: 30
height: 57
}
}
MenuText {
visible: slideNum === 3
anchors.centerIn: parent
text: "slide3"
}
function nextSlide() {
audioManager.play(audioManager.idMENUCLICK)
slideNum++
if(slideNum > 2) {
settings.setValue("firstAppStart",1)
firstAppStart = false
opacity = 0
if(windowMainItem.lastState === "gameOver") {
window.state = "gameOver"
} else {
window.state = "game"
}
}
}
function enterScene() {}