Changeset View
Changeset View
Standalone View
Standalone View
src/activities/planegame/Planegame.qml
Show All 29 Lines | 28 | ActivityBase { | |||
---|---|---|---|---|---|
30 | focus: true | 30 | focus: true | ||
31 | 31 | | |||
32 | onStart: { focus = true; } | 32 | onStart: { focus = true; } | ||
33 | onStop: { } | 33 | onStop: { } | ||
34 | 34 | | |||
35 | Keys.onPressed: Activity.processPressedKey(event) | 35 | Keys.onPressed: Activity.processPressedKey(event) | ||
36 | Keys.onReleased: Activity.processReleasedKey(event) | 36 | Keys.onReleased: Activity.processReleasedKey(event) | ||
37 | 37 | | |||
38 | property string mode: "lower" | ||||
39 | | ||||
38 | property var dataset | 40 | property var dataset | ||
39 | property var tutorialInstructions | 41 | property var tutorialInstructions | ||
40 | property bool showTutorial: false | 42 | property bool showTutorial: false | ||
41 | 43 | | |||
42 | property int oldWidth: width | 44 | property int oldWidth: width | ||
43 | onWidthChanged: { | 45 | onWidthChanged: { | ||
44 | // Reposition helico and clouds, same for height | 46 | // Reposition helico and clouds, same for height | ||
45 | Activity.repositionObjectsOnWidthChanged(width / oldWidth) | 47 | Activity.repositionObjectsOnWidthChanged(width / oldWidth) | ||
Show All 11 Lines | 58 | pageComponent: Image { | |||
57 | id: background | 59 | id: background | ||
58 | anchors.fill: parent | 60 | anchors.fill: parent | ||
59 | signal start | 61 | signal start | ||
60 | signal stop | 62 | signal stop | ||
61 | source: Activity.url + "../algorithm/resource/desert_scene.svg" | 63 | source: Activity.url + "../algorithm/resource/desert_scene.svg" | ||
62 | sourceSize.width: parent.width | 64 | sourceSize.width: parent.width | ||
63 | 65 | | |||
64 | Component.onCompleted: { | 66 | Component.onCompleted: { | ||
67 | dialogActivityConfig.initialize() | ||||
65 | activity.start.connect(start) | 68 | activity.start.connect(start) | ||
66 | activity.stop.connect(stop) | 69 | activity.stop.connect(stop) | ||
67 | } | 70 | } | ||
68 | 71 | | |||
69 | QtObject { | 72 | QtObject { | ||
70 | id: items | 73 | id: items | ||
71 | property alias background: background | 74 | property alias background: background | ||
72 | property alias bar: bar | 75 | property alias bar: bar | ||
73 | property alias bonus: bonus | 76 | property alias bonus: bonus | ||
77 | property var levels: activity.datasetLoader.item !== null ? activity.datasetLoader.item.data : null | ||||
74 | property alias score: score | 78 | property alias score: score | ||
75 | property alias plane: plane | 79 | property alias plane: plane | ||
76 | property GCAudio audioVoices: activity.audioVoices | 80 | property GCAudio audioVoices: activity.audioVoices | ||
77 | property GCSfx audioEffects: activity.audioEffects | 81 | property GCSfx audioEffects: activity.audioEffects | ||
78 | property alias movePlaneTimer: movePlaneTimer | 82 | property alias movePlaneTimer: movePlaneTimer | ||
79 | property alias cloudCreation: cloudCreation | 83 | property alias cloudCreation: cloudCreation | ||
80 | property bool showTutorial: activity.showTutorial | 84 | property bool showTutorial: activity.showTutorial | ||
85 | property string letterMode: activity.mode | ||||
jjazeix: string? | |||||
81 | } | 86 | } | ||
82 | 87 | | |||
83 | onStart: { Activity.start(items, dataset) } | 88 | onStart: { Activity.start(items, dataset) } | ||
84 | onStop: { Activity.stop() } | 89 | onStop: { Activity.stop() } | ||
85 | 90 | | |||
86 | //Tutorial section starts | 91 | //Tutorial section starts | ||
87 | Loader { | 92 | Loader { | ||
88 | active: showTutorial | 93 | active: showTutorial | ||
Show All 26 Lines | 118 | MultiPointTouchArea { | |||
115 | touchPoints: [ TouchPoint { id: point1 } ] | 120 | touchPoints: [ TouchPoint { id: point1 } ] | ||
116 | 121 | | |||
117 | onReleased: { | 122 | onReleased: { | ||
118 | plane.x = point1.x - plane.width / 2 | 123 | plane.x = point1.x - plane.width / 2 | ||
119 | plane.y = point1.y - plane.height / 2 | 124 | plane.y = point1.y - plane.height / 2 | ||
120 | } | 125 | } | ||
121 | } | 126 | } | ||
122 | 127 | | |||
128 | DialogChooseLevel { | ||||
129 | id: dialogActivityConfig | ||||
130 | currentActivity: activity.activityInfo | ||||
131 | onSaveData: { | ||||
132 | levelFolder = dialogActivityConfig.chosenLevel | ||||
133 | currentActivity.currentLevel = dialogActivityConfig.chosenLevel | ||||
134 | ApplicationSettings.setCurrentLevel(currentActivity.name, dialogActivityConfig.chosenLevel) | ||||
135 | home() | ||||
136 | activity.focus = true | ||||
137 | background.stop() | ||||
138 | background.start() | ||||
139 | } | ||||
140 | onLoadData: { | ||||
141 | if(activityData && activityData["mode"]) { | ||||
142 | activity.mode = activityData["mode"]; | ||||
143 | Activity.initLevel() | ||||
144 | } | ||||
145 | } | ||||
146 | onClose: { | ||||
147 | home() | ||||
148 | } | ||||
149 | onStartActivity: { | ||||
150 | background.start() | ||||
151 | } | ||||
152 | } | ||||
153 | | ||||
123 | DialogHelp { | 154 | DialogHelp { | ||
124 | id: dialogHelp | 155 | id: dialogHelp | ||
125 | onClose: home() | 156 | onClose: home() | ||
126 | } | 157 | } | ||
127 | 158 | | |||
128 | Bar { | 159 | Bar { | ||
129 | id: bar | 160 | id: bar | ||
130 | content: BarEnumContent { value: items.showTutorial ? (help | home) : (help | home | level) } | 161 | content: BarEnumContent { value: items.showTutorial ? (help | home | activityConfig) : (help | home | level | activityConfig) } | ||
131 | onHelpClicked: displayDialog(dialogHelp) | 162 | onHelpClicked: displayDialog(dialogHelp) | ||
132 | onPreviousLevelClicked: Activity.previousLevel() | 163 | onPreviousLevelClicked: Activity.previousLevel() | ||
133 | onNextLevelClicked: Activity.nextLevel() | 164 | onNextLevelClicked: Activity.nextLevel() | ||
134 | onHomeClicked: activity.home() | 165 | onHomeClicked: activity.home() | ||
166 | onActivityConfigClicked: { | ||||
167 | displayDialog(dialogActivityConfig) | ||||
168 | } | ||||
135 | } | 169 | } | ||
136 | 170 | | |||
137 | Bonus { | 171 | Bonus { | ||
138 | id: bonus | 172 | id: bonus | ||
139 | Component.onCompleted: win.connect(Activity.nextLevel) | 173 | Component.onCompleted: win.connect(Activity.nextLevel) | ||
140 | } | 174 | } | ||
141 | 175 | | |||
142 | Score { | 176 | Score { | ||
▲ Show 20 Lines • Show All 41 Lines • Show Last 20 Lines |
string?