Durdles - 2-Player Action Game
import Felgo 4.0
import QtQuick 2.0
import "../common"
import ".."
import "../entities"
import "../controls"
SceneBase {
id: gameScene
property string activeLevelFileName
property var activeLevel
property int countdown: 0
property alias loader: loader
signal offLake(string playerVariationType)
function setLevel(fileName) {
activeLevelFileName = fileName
}
PhysicsWorld {
id: world
debugDrawVisible: false
updatesPerSecondForPhysics: GameInfo.gamePaused ? 0 : 30
z: 0
}
Loader {
id: loader
source: activeLevelFileName ? "../levels/" + activeLevelFileName : ""
onLoaded: {
activeLevel = item
countdown = 3
GameInfo.gamePaused = true
}
}
Text {
anchors.centerIn: parent
color: "black"
font.pixelSize: countdown > 0 ? 200 : 18
font.bold: true
text: countdown > 0 ? countdown : ""
font.family: standardFont.name
opacity: 1
}
Timer {
repeat: true
running: countdown > 0
onTriggered: {
countdown--
if (countdown==0) GameInfo.gamePaused = false