-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMap.qml
945 lines (905 loc) · 17.3 KB
/
Map.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
import QtQuick 2.6
import QtQuick.Particles 2.0
import QtQuick.Controls 2.0
import QtQuick.Controls.Material 2.0
import "qrc:/thymio-vpl2" as VPL2
import "widgets"
Rectangle {
// background gradient
gradient: Gradient {
GradientStop {
position: 0.00;
color: "#0c0e57";
}
GradientStop {
position: 0.66;
color: "#17abbc";
}
GradientStop {
position: 1.00;
color: "#f7f8d1";
}
}
// background clouds
AnimatedImageX {
x1: -30
x2: 0
y: 0
width: parent.width + 30
height: width * 0.310
source: "images/map/clouds-back.png"
duration: 7000
}
// the drawing of the map
Item {
width: 2827
height: 2050
transformOrigin: Item.BottomLeft
// FIXME: cleanup computation of size of misison list at right-side of the screen
scale: Math.min((parent.width - 200) / width, parent.height / height)
anchors.bottom: parent.bottom
// general particles
ParticleSystem {
id: particleSystem
}
HoveringImageParticle {
source: "images/map/sustain-particle.png"
system: particleSystem
groups: "hovering1"
z: -1
}
HoveringImageParticle {
source: "images/map/sustain-particle-2.png"
system: particleSystem
groups: "hovering2"
z: -1
}
HoveringVaporImageParticle {
system: particleSystem
groups: "hoveringVapor"
z: 2
}
VaporImageParticle {
system: particleSystem
groups: "backVapor"
z: -1
}
VaporImageParticle {
system: particleSystem
groups: "frontVapor"
z: 2
}
VaporImageParticle {
system: particleSystem
groups: "volcanoVapor"
source: "../images/map/vapor-particle-volcano.png"
z: 2
}
ImageParticle {
source: "images/map/snow-particle.png"
system: particleSystem
groups: "snow"
z: 2
}
// islands
AnimatedImageY {
source: "images/map/island03.png"
x: 1700
duration: 4000
y1: 40
y2: 60
HoveringEmitter {
system: particleSystem
x: 60
y: 635
width: 60
deltaWidth: 40
startDepth: 180
emitRate: 14
endSize: 80
lifeSpan: 1000
velocityMagnitude: 380
accelerationMagnitude: 33
}
HoveringEmitter {
system: particleSystem
x: 610
y: 560
width: 60
deltaWidth: 40
startDepth: 190
emitRate: 14
endSize: 80
lifeSpan: 1000
velocityMagnitude: 380
accelerationMagnitude: 33
}
HoveringEmitter {
system: particleSystem
x: 225
y: 450
width: 60
deltaWidth: 40
startDepth: 190
emitRate: 14
endSize: 80
lifeSpan: 1000
velocityMagnitude: 380
accelerationMagnitude: 33
}
}
AnimatedImageY {
source: "images/map/island04.png"
x: 300
duration: 4000
y1: 130
y2: 110
AnimatedImageX {
x1: -78
x2: -58
y: 208
source: "images/map/island04-blocks-left.png"
duration: 4000
}
AnimatedImageX {
x1: 640
x2: 615
y: 450
source: "images/map/island04-blocks-right.png"
duration: 4000
}
Emitter {
system: particleSystem
group: "snow"
x: 70
y: -160
width: 770
height: 200
shape: EllipseShape {}
emitRate: 9
lifeSpan: 10500
lifeSpanVariation: 500
size: 6
velocity: AngleDirection {
angle: 90
angleVariation: 5
magnitude: 40
magnitudeVariation: 5
}
acceleration: AngleDirection {
angle: -180
angleVariation: 5
magnitude: 5
magnitudeVariation: 2
}
}
HoveringEmitter {
system: particleSystem
x: 180
y: 774
width: 230
startDepth: 330
deltaWidth: 140
emitRate: 16
endSize: 170
lifeSpan: 2200
velocityMagnitude: 430
accelerationMagnitude: 40
}
Emitter {
system: particleSystem
group: "frontVapor"
x: 174
y: 494
width: 8
height: 18
shape: EllipseShape {}
emitRate: 2
lifeSpan: 5000
lifeSpanVariation: 1000
size: 55
endSize: 100
sizeVariation: 16
velocity: AngleDirection {
angle: -175
angleVariation: 10
magnitude: 32
magnitudeVariation: 9
}
acceleration: AngleDirection {
angle: -155
angleVariation: 9
magnitude: 10
magnitudeVariation: 3
}
}
Emitter {
system: particleSystem
group: "backVapor"
x: 482
y: 484
width: 8
height: 18
shape: EllipseShape {}
emitRate: 2
lifeSpan: 5000
lifeSpanVariation: 1000
size: 70
endSize: 140
sizeVariation: 16
velocity: AngleDirection {
angle: 0
angleVariation: 10
magnitude: 30
magnitudeVariation: 8
}
acceleration: AngleDirection {
angle: -60
angleVariation: 11
magnitude: 9
magnitudeVariation: 2
}
}
}
// middle clouds
AnimatedImageX {
x1: 0.1 * parent.width
x2: -0.1 * parent.width
y: 0.2 * parent.height
width: parent.width * 1.2
height: width * 0.346
source: "images/map/clouds-middle.png"
duration: 7000
}
AnimatedImageY {
source: "images/map/island02.png"
x: 1152
duration: 5000
y1: 780
y2: 800
Image {
source: "images/map/island02-cascade-bottom-left.png"
x: 299
y: 1081
z: -2
}
HoveringEmitter {
system: particleSystem
x: 238
y: 1075
width: 100
deltaWidth: 60
startDepth: 160
emitRate: 20
endSize: 100
lifeSpan: 800
velocityMagnitude: 600
accelerationMagnitude: 60
}
HoveringEmitter {
system: particleSystem
x: 410
y: 1062
width: 290
deltaWidth: 140
startDepth: 150
emitRate: 20
endSize: 180
lifeSpan: 1300
velocityMagnitude: 600
accelerationMagnitude: 60
}
HoveringEmitter {
system: particleSystem
x: 978
y: 1004
width: 250
deltaWidth: 130
startDepth: 200
emitRate: 20
endSize: 180
lifeSpan: 1400
velocityMagnitude: 600
accelerationMagnitude: 60
}
Emitter {
system: particleSystem
group: "volcanoVapor"
x: 338
y: 13
width: 140
height: 30
shape: EllipseShape {}
emitRate: 9
lifeSpan: 7000
lifeSpanVariation: 2000
size: 90
endSize: 320
sizeVariation: 60
velocity: AngleDirection {
angle: -90
angleVariation: 15
magnitude: 50
magnitudeVariation: 15
}
acceleration: AngleDirection {
angle: -155
angleVariation: 13
magnitude: 11
magnitudeVariation: 3
}
}
Emitter {
system: particleSystem
group: "volcanoVapor"
x: 211
y: 135
width: 30
height: 10
shape: EllipseShape {}
emitRate: 4
lifeSpan: 7000
lifeSpanVariation: 2000
size: 50
endSize: 160
sizeVariation: 30
velocity: AngleDirection {
angle: -90
angleVariation: 15
magnitude: 25
magnitudeVariation: 7
}
acceleration: AngleDirection {
angle: -155
angleVariation: 13
magnitude: 6
magnitudeVariation: 1
}
}
Emitter {
system: particleSystem
group: "volcanoVapor"
x: 591
y: 128
width: 20
height: 10
shape: EllipseShape {}
emitRate: 3
lifeSpan: 7000
lifeSpanVariation: 2000
size: 45
endSize: 140
sizeVariation: 26
velocity: AngleDirection {
angle: -90
angleVariation: 15
magnitude: 18
magnitudeVariation: 6
}
acceleration: AngleDirection {
angle: -152
angleVariation: 13
magnitude: 5
magnitudeVariation: 1
}
}
Emitter {
system: particleSystem
group: "frontVapor"
x: 600
y: 917
width: 30
height: 30
shape: EllipseShape {}
emitRate: 3
lifeSpan: 5000
lifeSpanVariation: 1000
size: 60
endSize: 130
sizeVariation: 18
velocity: AngleDirection {
angle: 0
angleVariation: 10
magnitude: 30
magnitudeVariation: 8
}
acceleration: AngleDirection {
angle: -65
angleVariation: 11
magnitude: 8
magnitudeVariation: 2
}
}
Emitter {
system: particleSystem
group: "frontVapor"
x: 790
y: 985
width: 30
height: 30
shape: EllipseShape {}
emitRate: 2
lifeSpan: 5000
lifeSpanVariation: 1000
size: 60
endSize: 110
sizeVariation: 16
velocity: AngleDirection {
angle: 0
angleVariation: 10
magnitude: 30
magnitudeVariation: 8
}
acceleration: AngleDirection {
angle: -35
angleVariation: 11
magnitude: 8
magnitudeVariation: 2
}
}
Emitter {
system: particleSystem
group: "frontVapor"
x: 1315
y: 828
width: 9
height: 27
shape: EllipseShape {}
emitRate: 3
lifeSpan: 5000
lifeSpanVariation: 1000
size: 70
endSize: 140
sizeVariation: 16
velocity: AngleDirection {
angle: 0
angleVariation: 10
magnitude: 30
magnitudeVariation: 8
}
acceleration: AngleDirection {
angle: -35
angleVariation: 11
magnitude: 8
magnitudeVariation: 2
}
}
Emitter {
system: particleSystem
group: "frontVapor"
x: 183
y: 1027
width: 7
height: 15
shape: EllipseShape {}
emitRate: 2
lifeSpan: 5000
lifeSpanVariation: 1000
size: 60
endSize: 110
sizeVariation: 16
velocity: AngleDirection {
angle: -175
angleVariation: 10
magnitude: 32
magnitudeVariation: 9
}
acceleration: AngleDirection {
angle: -160
angleVariation: 9
magnitude: 10
magnitudeVariation: 3
}
}
Emitter {
system: particleSystem
group: "frontVapor"
x: 1468
y: 640
width: 18
height: 18
shape: EllipseShape {}
emitRate: 3
lifeSpan: 5000
lifeSpanVariation: 1000
size: 40
endSize: 110
sizeVariation: 16
velocity: AngleDirection {
angle: 0
angleVariation: 10
magnitude: 30
magnitudeVariation: 8
}
acceleration: AngleDirection {
angle: -65
angleVariation: 11
magnitude: 8
magnitudeVariation: 2
}
}
Emitter {
system: particleSystem
group: "backVapor"
x: 1290
y: 180
width: 8
height: 18
shape: EllipseShape {}
emitRate: 2
lifeSpan: 5000
lifeSpanVariation: 1000
size: 100
endSize: 180
sizeVariation: 16
velocity: AngleDirection {
angle: -20
angleVariation: 10
magnitude: 30
magnitudeVariation: 8
}
acceleration: AngleDirection {
angle: -60
angleVariation: 11
magnitude: 9
magnitudeVariation: 2
}
}
AnimatedSprite {
source: "images/map/island02-wave-volcano-left.png"
frameCount: 23
frameWidth: width
frameHeight: height
frameRate: 5
x: 50
y: 198
width: 237
height: 111
}
AnimatedSprite {
source: "images/map/island02-wave-center.png"
frameCount: 23
frameWidth: width
frameHeight: height
frameRate: 5
x: 637
y: 379
width: 244
height: 138
}
AnimatedSprite {
source: "images/map/island02-wave-volcano-right.png"
frameCount: 23
frameWidth: width
frameHeight: height
frameRate: 5
x: 548
y: 174
width: 159
height: 58
}
AnimatedSprite {
source: "images/map/island02-cascade-left.png"
frameCount: 3
frameWidth: width
frameHeight: height
frameRate: 10
x: 0
y: 305
width: 111
height: 115
}
AnimatedSprite {
source: "images/map/island02-cascade-volcano.png"
frameCount: 3
frameWidth: width
frameHeight: height
frameRate: 10
x: 207
y: 25
width: 418
height: 209
}
}
AnimatedImageY {
source: "images/map/island01.png"
x: 151
duration: 4000
y1: 1020
y2: 1040
HoveringEmitter {
system: particleSystem
x: 325
y: 836
width: 310
deltaWidth: 150
startDepth: 150
emitRate: 20
endSize: 180
lifeSpan: 1300
velocityMagnitude: 600
accelerationMagnitude: 60
}
Emitter {
system: particleSystem
group: "frontVapor"
x: 243
y: 687
width: 9
height: 27
shape: EllipseShape {}
emitRate: 3
lifeSpan: 5000
lifeSpanVariation: 1000
size: 70
endSize: 140
sizeVariation: 16
velocity: AngleDirection {
angle: -175
angleVariation: 10
magnitude: 32
magnitudeVariation: 9
}
acceleration: AngleDirection {
angle: -160
angleVariation: 9
magnitude: 10
magnitudeVariation: 3
}
}
Emitter {
system: particleSystem
group: "frontVapor"
x: 542
y: 703
width: 40
height: 40
shape: EllipseShape {}
emitRate: 3
lifeSpan: 5000
lifeSpanVariation: 1000
size: 60
endSize: 130
sizeVariation: 18
velocity: AngleDirection {
angle: 0
angleVariation: 10
magnitude: 30
magnitudeVariation: 8
}
acceleration: AngleDirection {
angle: -65
angleVariation: 11
magnitude: 8
magnitudeVariation: 2
}
}
Emitter {
system: particleSystem
group: "backVapor"
x: 770
y: 388
width: 8
height: 18
shape: EllipseShape {}
emitRate: 2
lifeSpan: 4000
lifeSpanVariation: 1000
size: 70
endSize: 140
sizeVariation: 16
velocity: AngleDirection {
angle: -20
angleVariation: 10
magnitude: 30
magnitudeVariation: 8
}
acceleration: AngleDirection {
angle: -60
angleVariation: 11
magnitude: 9
magnitudeVariation: 2
}
}
Emitter {
system: particleSystem
group: "backVapor"
x: 136
y: 380
width: 13
height: 27
shape: EllipseShape {}
emitRate: 2
lifeSpan: 4000
lifeSpanVariation: 1000
size: 90
endSize: 140
sizeVariation: 16
velocity: AngleDirection {
angle: -155
angleVariation: 10
magnitude: 32
magnitudeVariation: 9
}
acceleration: AngleDirection {
angle: -130
angleVariation: 9
magnitude: 10
magnitudeVariation: 3
}
}
AnimatedSprite {
source: "images/map/island01-wave-low.png"
frameCount: 23
frameWidth: width
frameHeight: height
frameRate: 5
x: 90
y: 500
width: 523
height: 112
}
AnimatedSprite {
source: "images/map/island01-wave-up.png"
frameCount: 23
frameWidth: width
frameHeight: height
frameRate: 5
x: 423
y: 327
width: 154
height: 147
}
AnimatedSprite {
source: "images/map/island01-cascade-low.png"
frameCount: 3
frameWidth: width
frameHeight: height
frameRate: 10
x: 0
y: 439
width: 901
height: 299
}
AnimatedSprite {
source: "images/map/island01-cascade-up.png"
frameCount: 3
frameWidth: width
frameHeight: height
frameRate: 10
x: 514
y: 299
width: 64
height: 65
}
}
}
// foreground clouds
AnimatedImageX {
x1: 0
x2: -60
anchors.bottom: parent.bottom
width: parent.width + 60
height: width * 0.234
source: "images/map/clouds-front.png"
duration: 7000
}
// list of missions
ListModel {
id: missionsList
ListElement {
name: qsTr("Hello, anyone?");
source: "Mission1.qml";
locked: false
successRate: 2
}
ListElement {
name: qsTr("Out of the cave");
source: "Mission2.qml";
locked: false
successRate: 1
}
ListElement {
name: qsTr("The platforms");
source: "Mission3.qml";
locked: false
successRate: 0
}
ListElement {
name: qsTr("lorem");
source: "Mission2.qml";
locked: true
successRate: 0
}
}
// view of liste of missions
ListView {
id: missionsView
anchors.right: parent.right
anchors.rightMargin: 20
anchors.top: parent.top
anchors.topMargin: 20
anchors.bottom: parent.bottom
anchors.bottomMargin: 130
width: 180
spacing: 12
model: missionsList
delegate: Row {
id: row
spacing: 8
padding: 0
Button {
id: control
implicitWidth: 160
text: missionsList.get(index).locked ? "<img src=\"qrc:/images/ic_lock_white_24px.svg\" />" : index + '. ' + name
background: Rectangle {
color: control.highlighted ? "#30efff16" : "#30ffffff"
border.color: control.highlighted ? "#a0efff16" : "#50ffffff"
radius: 5
}
contentItem: Text {
text: control.text
font: control.font
color: control.highlighted ? "#efff16" : Material.primaryTextColor
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight
}
onClicked: missionsView.currentIndex = index;
highlighted: row.ListView.isCurrentItem
}
}
}
// mission summary
Pane {
id: missionSummary
anchors.right: parent.right
anchors.rightMargin: 20
anchors.bottom: parent.bottom
anchors.bottomMargin: 20
height: 70
width: missionsView.width
visible: missionsView.currentIndex !== -1
background: Rectangle {
color: "#30ffffff"
border.color: "#50ffffff"
radius: 5
}
Row {
Repeater {
model: 3
VPL2.HDPIImage {
source: (missionsView.currentIndex !== -1 && missionsList.get(missionsView.currentIndex).successRate > index) ?
"images/ic_star_rate_yellow_18px.svg" :
"images/ic_star_rate_white_18px.svg"
width: 24
height: 24
}
}
}
Button {
anchors.right: parent.right
width: 44
height: 44
background: Rectangle {
color: "white"
width: 44
height: 44
radius: 22
}
contentItem: VPL2.HDPIImage {
source: "images/ic_play_arrow_black_24px.svg"
width: 24
height: 24
}
padding: 10
leftPadding: padding
rightPadding: padding
onClicked: {
if (missionsView.currentIndex !== -1) {
loader.source = missionsList.get(missionsView.currentIndex).source;
}
}
}
}
}