Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import QtQuick 2.9
- import QtQuick.Window 2.3
- import QtQuick.Controls 2.4
- import Bacon2D 1.0
- ApplicationWindow {
- id: window
- height: 640
- width: 480
- visible: true
- Game {
- id: game
- anchors.fill: parent
- currentScene: scene
- visible: true
- anchors.centerIn: parent
- Settings {
- id: settings
- property int highScore: 0
- property bool noSound: false
- }
- Scene {
- id: scene
- physics: true
- width: parent.width
- height: parent.height
- Entity {
- width: parent.width
- height: parent.height
- updateInterval: 50
- behavior: ScriptBehavior {
- script: {
- var newPos = entity.x + 5
- entity.x = newPos > scene.width ? 0 : newPos
- console.log("update: x -> ", entity.x)
- }
- }
- Rectangle {
- id: entity
- width: 50
- height: 50
- color: "red"
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement