Changeset View
Changeset View
Standalone View
Standalone View
src/activities/planegame/Planegame.qml
Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Line(s) | 56 | pageComponent: Image { | |||
---|---|---|---|---|---|
57 | id: background | 57 | id: background | ||
58 | anchors.fill: parent | 58 | anchors.fill: parent | ||
59 | signal start | 59 | signal start | ||
60 | signal stop | 60 | signal stop | ||
61 | source: Activity.url + "../algorithm/resource/desert_scene.svg" | 61 | source: Activity.url + "../algorithm/resource/desert_scene.svg" | ||
62 | sourceSize.width: parent.width | 62 | sourceSize.width: parent.width | ||
63 | 63 | | |||
64 | Component.onCompleted: { | 64 | Component.onCompleted: { | ||
65 | dialogActivityConfig.initialize() | ||||
65 | activity.start.connect(start) | 66 | activity.start.connect(start) | ||
66 | activity.stop.connect(stop) | 67 | activity.stop.connect(stop) | ||
67 | } | 68 | } | ||
68 | 69 | | |||
69 | QtObject { | 70 | QtObject { | ||
70 | id: items | 71 | id: items | ||
71 | property alias background: background | 72 | property alias background: background | ||
72 | property alias bar: bar | 73 | property alias bar: bar | ||
73 | property alias bonus: bonus | 74 | property alias bonus: bonus | ||
75 | property var levels: activity.datasetLoader.item.data | ||||
74 | property alias score: score | 76 | property alias score: score | ||
75 | property alias plane: plane | 77 | property alias plane: plane | ||
76 | property GCAudio audioVoices: activity.audioVoices | 78 | property GCAudio audioVoices: activity.audioVoices | ||
77 | property GCSfx audioEffects: activity.audioEffects | 79 | property GCSfx audioEffects: activity.audioEffects | ||
78 | property alias movePlaneTimer: movePlaneTimer | 80 | property alias movePlaneTimer: movePlaneTimer | ||
79 | property alias cloudCreation: cloudCreation | 81 | property alias cloudCreation: cloudCreation | ||
80 | property bool showTutorial: activity.showTutorial | 82 | property bool showTutorial: activity.showTutorial | ||
81 | } | 83 | } | ||
jjazeix: string? | |||||
82 | 84 | | |||
83 | onStart: { Activity.start(items, dataset) } | 85 | onStart: { Activity.start(items, dataset) } | ||
84 | onStop: { Activity.stop() } | 86 | onStop: { Activity.stop() } | ||
85 | 87 | | |||
86 | //Tutorial section starts | 88 | //Tutorial section starts | ||
87 | Loader { | 89 | Loader { | ||
88 | active: showTutorial | 90 | active: showTutorial | ||
89 | anchors.fill: parent | 91 | anchors.fill: parent | ||
Show All 25 Lines | 115 | MultiPointTouchArea { | |||
115 | touchPoints: [ TouchPoint { id: point1 } ] | 117 | touchPoints: [ TouchPoint { id: point1 } ] | ||
116 | 118 | | |||
117 | onReleased: { | 119 | onReleased: { | ||
118 | plane.x = point1.x - plane.width / 2 | 120 | plane.x = point1.x - plane.width / 2 | ||
119 | plane.y = point1.y - plane.height / 2 | 121 | plane.y = point1.y - plane.height / 2 | ||
120 | } | 122 | } | ||
121 | } | 123 | } | ||
122 | 124 | | |||
125 | DialogChooseLevel { | ||||
126 | id: dialogActivityConfig | ||||
127 | currentActivity: activity.activityInfo | ||||
128 | | ||||
129 | onSaveData: { | ||||
130 | levelFolder = dialogActivityConfig.chosenLevel | ||||
131 | currentActivity.currentLevel = dialogActivityConfig.chosenLevel | ||||
132 | ApplicationSettings.setCurrentLevel(currentActivity.name, dialogActivityConfig.chosenLevel) | ||||
133 | home() | ||||
134 | } | ||||
135 | onClose: { | ||||
136 | home() | ||||
137 | } | ||||
138 | onStartActivity: { | ||||
139 | background.start() | ||||
140 | } | ||||
141 | } | ||||
142 | | ||||
123 | DialogHelp { | 143 | DialogHelp { | ||
124 | id: dialogHelp | 144 | id: dialogHelp | ||
125 | onClose: home() | 145 | onClose: home() | ||
126 | } | 146 | } | ||
127 | 147 | | |||
128 | Bar { | 148 | Bar { | ||
129 | id: bar | 149 | id: bar | ||
130 | content: BarEnumContent { value: items.showTutorial ? (help | home) : (help | home | level) } | 150 | content: BarEnumContent { value: items.showTutorial ? (help | home | activityConfig) : (help | home | level | activityConfig) } | ||
131 | onHelpClicked: displayDialog(dialogHelp) | 151 | onHelpClicked: displayDialog(dialogHelp) | ||
132 | onPreviousLevelClicked: Activity.previousLevel() | 152 | onPreviousLevelClicked: Activity.previousLevel() | ||
133 | onNextLevelClicked: Activity.nextLevel() | 153 | onNextLevelClicked: Activity.nextLevel() | ||
134 | onHomeClicked: activity.home() | 154 | onHomeClicked: activity.home() | ||
155 | onActivityConfigClicked: { | ||||
156 | displayDialog(dialogActivityConfig) | ||||
157 | } | ||||
135 | } | 158 | } | ||
136 | 159 | | |||
137 | Bonus { | 160 | Bonus { | ||
138 | id: bonus | 161 | id: bonus | ||
139 | Component.onCompleted: win.connect(Activity.nextLevel) | 162 | Component.onCompleted: win.connect(Activity.nextLevel) | ||
140 | } | 163 | } | ||
141 | 164 | | |||
142 | Score { | 165 | Score { | ||
▲ Show 20 Lines • Show All 41 Lines • Show Last 20 Lines |
string?