CarChallenge Demo
import QtQuick 2.0
import Felgo 4.0
GameWindow {
id: window
screenWidth: 960
screenHeight: 640
activeScene: scene
EntityManager {
id: entityManager
entityContainer: level
}
Scene {
id: scene
width: 640
height: 640
Image {
id: background
source: Qt.resolvedUrl("../assets/img/asphalt_background.png")
width: parent.width*1.8
height: parent.height*1.8
anchors.centerIn: parent
}
PhysicsWorld {
id: world
updatesPerSecondForPhysics: 60
}
Level {
id: level
}
focus: true
Keys.forwardTo: [level.player_red.controller, level.player_blue.controller]
}
JoystickControllerHUD {
anchors.bottom: parent.bottom
joystickRadius: scene.x/2
source: Qt.resolvedUrl("../assets/img/joystick_background.png")
thumbSource: Qt.resolvedUrl("../assets/img/joystick_thumb.png")
property variant playerTwoxisController: level.player_red.getComponent("TwoAxisController")
onControllerXPositionChanged: playerTwoxisController.xAxis = controllerXPosition;