-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain-en.strand
4617 lines (3972 loc) · 129 KB
/
main-en.strand
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
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
::start
// some info for if you want to mod it:
//
// basic syntax examples:
// ::passage title
// [[basic link]]
// [[link with different label>passage title]]
// [[link with different action|this.something=true;this.goto('passage title');]]
// <<if this.something>><<elseif this.somethingElse>><<endif>>
// <<do this.something=true;>>
// <<print this.something>>
// >passage break
//
// js examples:
// this.goto('passage')
// this.show('texture', { duration, x, y, scale, animate, freq })
// this.scrim(amount, duration)
// this.tween(object, 'property', to, duration, from, ease)
// this.gameObject - npc/interrupt that triggered the dialog
// this.scene - game scene
// this.voice - audio to play as letters tick in
// this.ease - easing functions
//
// game object stuff:
// this.Area(name, [objects])
// this.Npc({ passage, x, y )
// this.Goto({ area, x, y }, { x, y, width, height })
// this.Prop({ texture, x, y, alpha, scale, flip, blur, animate, offset })
// this.PropParallax({ texture, alpha, scale, flip, blur, mult, animate, offset }),
// this.Block({ x, y, width, height, type, radius })
// this.Poly({ x, y, width, verts })
// this.Interrupt({ passage, x, y, width, height })
//
// palette stuff:
// this.scene.screenFilter.palette([255,255,255],[0,0,0]);
// this.scene.screenFilter.randomizePalette();
<<if !this.started>>
<<do
this.musicSynced = (m) => {
if (!this.howler) {
this.howler = this.music(m);
return this.howler;
}
const oldHowl = Howler._howls.find(i => i._endTimers[this.howler]);
if (!oldHowl) {
this.howler = this.music(m);
return this.howler;
}
const time = oldHowl.seek(undefined, this.howler);
oldHowl.fade(0.5, oldHowl.volume(undefined, this.howler), 1000, this.howler);
this.howler = this.music(m);
if (!this.howler) return;
const newHowl = Howler._howls.find(i => i._endTimers[this.howler]);
newHowl.seek(time, this.howler);
newHowl.fade(0, 0.5, 1000, this.howler);
return this.howler;
};
// setup areas
const TestSpecialNpc = (options) => {
const npc = this.Npc({
...options,
bodyCollision: { isStatic: true },
bodySensor: { plugin: { label: 'I Am Special' }, radius: 80 },
focus: { x: options.x + 100, y: options.y },
});
return npc;
}
const Queen = (options) => {
const npc = this.Npc({
...options,
bodyCollision: { isStatic: true },
bodySensor: { plugin: { label: 'Mother' }, radius: 100 },
focus: { x: 0, y: -200 },
});
npc.bodySensor.scale(5,1.2);
npc.bodyCollision.scale(25,6);
npc.bodyCollision.move(0,-50);
npc.display.container.visible = false;
const prop = this.Prop({ ...options, texture: 'queenIdle', scale: (options.scale || 1) * 0.8 });
return [npc, prop];
}
this.AntProp = (options) => {
return [
this.Prop({ texture: 'basicAntIdle', freq: 1/200, ...options, scale: 0.52 * (options.scale || 1) }),
this.Prop({ texture: 'shadows', offset: (options.offset || 0)-5, ...options, scale: 0.7 * (options.scale || 1) }),
];
};
this.TentMedium = (options) => {
const block = this.Block({ type: 'circle', x: options.x, y: options.y-110, radius: 80 });
block.body.scale(2,1);
const result = [
this.Prop({ texture: 'mediumTent', x: options.x, y: options.y, offset: -90, flip: options.flip }),
block,
];
const door = { type: 'circle', x: options.x + (options.flip ? 120 : -120), y: options.y-75, radius: 40 };
if (options.goto) {
result.push(this.Goto(options.goto, door));
}
if (options.passage) {
result.push(this.Interrupt({ passage: options.passage, ...door }));
}
return result;
};
this.TentSmall = (options) => {
const block = this.Block({ type: 'circle', x: options.x, y: options.y-45, radius: 30 });
block.body.scale(2,1);
return [
this.Prop({ texture: 'smallTent', x: options.x, y: options.y, offset: -30, flip: options.flip }),
block,
];
};
this.Wagon = (options) => {
const block = this.Block({ type: 'circle', x: options.x, y: options.y-60, radius: 30 });
block.body.scale(4,1);
return [
this.Prop({ texture: 'wagon', x: options.x, y: options.y, offset: -50, flip: options.flip }),
block,
];
};
const PropParallaxAuto = (options) => {
const start = Date.now();
const gameObject = this.PropParallax(options);
gameObject.scripts.push({
gameObject,
update() {
gameObject.spr.tilePosition.x = (Date.now()-start)/1000 * options.speed;
},
});
return gameObject;
};
this.Area('intro', [
this.PropParallax({ texture: 'bg_parallax', offset: -100000, scale: 3, blur: true, mult: 0.6 }),
this.PropParallax({ texture: 'rain', offset: -50000, mult: 0.8, scale: 0.5, alpha: 0.1, freq: 1/200 }),
this.PropParallax({ texture: 'rain', offset: 100000, mult: 1.1, alpha: 0.2, freq: 1/200 }),
this.Prop({ texture: 'bg_intro', x: 827, y: 658, offset: -10000 }),
this.Poly({ verts: [-189,158, -207,-42, -143,-236, 215,-221, 462,-265, 569,-261, 638,-234, 706,-253, 1202,-225, 1335,-185, 1496,-50, 2103,-87, 2105,414, 1816,386, 1675,253, 1626,316, 1603,378, 1317,368, 1229,281, 968,190, 492,176, 175,221, -189,158] }),
this.Npc({ passage: 'intro-panic', x: 207, y: -75 }),
this.Npc({ passage: 'intro-panic', x: 290, y: 50, roam: 80 }),
this.Npc({ passage: 'intro-panic', x: 410, y: 120, roam: 50 }),
this.Npc({ passage: 'intro-panic', x: 641, y: -92, roam: 20 }),
this.Npc({ passage: 'intro-panic', x: 811, y: -26, roam: 50 }),
this.Npc({ passage: 'intro-panic', x: 855, y: 76, roam: 50 }),
this.Npc({ passage: 'intro-panic', x: 961, y: 5, roam: 100 }),
this.Npc({ passage: 'intro-panic', x: 1216, y: -51, roam: 50 }),
this.Npc({ passage: 'intro-panic', x: 1297, y: 76, roam: 50 }),
this.Npc({ passage: 'intro-panic', x: 1191, y: 159, roam: 50 }),
this.Npc({ passage: 'intro-panic', x: 1338, y: 136, roam: 20 }),
this.Npc({ passage: 'intro-panic', x: 1297, y: 76, roam: 50 }),
this.Npc({ passage: 'intro-panic', x: 1535, y: 226, roam: 50 }),
this.Npc({ passage: 'intro-panic', x: 1676, y: 126, roam: 100 }),
this.Npc({ passage: 'intro-panic', x: 1890, y: 197, roam: 20 }),
...this.AntProp({ x: 1830, y: 259 }),
...this.AntProp({ x: 1966, y: 292 }),
...this.AntProp({ x: 2010, y: -20 }),
...this.AntProp({ x: 1532, y: 71 }),
...this.AntProp({ x: 1485, y: 156 }),
...this.AntProp({ x: 1502, y: 305 }),
...this.Wagon({ x: 1807, y: 102, flip: true }),
...this.Wagon({ x: 723, y: 86, flip: true }),
this.Interrupt({ passage: 'intro-end', x: 1411, y: 183, height: 500 }),
this.Interrupt({ passage: 'intro-wall', x: -164, y: -35, height: 500 }),
]);
this.scene.areas.intro.forEach(i => {
if (i.roam) {
i.roam.freq.value = 3000;
i.roam.freq.range = 1000;
}
});
this.Area('march', [
PropParallaxAuto({ texture: 'bg_parallax', offset: -200000, scale: 3, blur: true, mult: 1, speed: -8 }),
PropParallaxAuto({ texture: 'bg_parallax', x: 500, offset: -100000, scale: 2, blur: true, mult: 1, alpha: 0.1, speed: -20 }),
this.Prop({ texture: 'basicAntRun', x: 620, y: 250+10, scale: 2 }),
this.Prop({ texture: 'basicAntRun', x: 410, y: 250+20, scale: 2 }),
this.Prop({ texture: 'basicAntRun', x: 180, y: 250+0, scale: 2 }),
this.Prop({ texture: 'basicAntRun', x: -10, y: 250+5, scale: 2 }),
this.Prop({ texture: 'basicAntRun', x: -210, y: 250+0, scale: 2 }),
this.Prop({ texture: 'basicAntRun', x: -400, y: 250+30, scale: 2 }),
this.Prop({ texture: 'basicAntRun', x: -620, y: 250+10, scale: 2 }),
this.PropParallax({ texture: 'marchScrim', offset: 100000 }),
]);
this.outsideant = this.Npc({ body: 'basicAnt', passage: 'outside-inn-ant', x: -745, y: 152 });
this.Area('inn-outside', [
this.PropParallax({ texture: 'bg_parallax', offset: -100000, scale: 3, blur: true, mult: 0.6 }),
this.PropParallax({ texture: 'rain', offset: -50000, mult: 0.8, scale: 0.5, alpha: 0.5, freq: 1/200 }),
this.PropParallax({ texture: 'rain', offset: 100000, mult: 1.1, freq: 1/200 }),
this.PropParallax({ texture: 'rain', offset: 200000, mult: 1.2, scale: 2, blur: true, freq: 1/300 }),
this.PropParallax({ texture: 'black', offset: 50000, mult: 0, alpha: 0.2 }),
this.Prop({ texture: 'bg_innOutside', x: -727, y: 488, offset: -10000 }),
this.Prop({ texture: 'InnOutside_flicker', x: -2157, y: 50 }),
this.Prop({ texture: 'rainSplash', x: -392, y: 129, freq: 1/100 }),
this.Prop({ texture: 'rainSplash', x: -914, y: -23, freq: 1/100 }),
this.Prop({ texture: 'rainSplash', x: -1367, y: 86, freq: 1/100 }),
this.Prop({ texture: 'pillBugIdle', x: -1731, y: -22 }),
this.Prop({ texture: 'shadows', x: -1731+20, y: -22+15, scale: 2, alpha: 0.5, offset: -20 }),
...this.Wagon({ x: 588, y: -60 }),
...this.AntProp({ x: 140, y: -86 }),
...this.AntProp({ x: 180, y: 5, flip: true }),
...this.AntProp({ x: 268, y: -11 }),
...this.AntProp({ x: 477, y: -24 }),
...this.AntProp({ x: 576, y: 28, flip: true }),
...this.AntProp({ x: 322, y: -61, flip: true }),
this.outsideant,
this.Poly({ verts: [168,130, 167,-135, -89,-107, -484,-104, -794,-120, -1360,-199, -1622,-214, -1623,174, -1026,146, -878,173, -781,158, -681,215, -367,200, -98,204, 168,130] }),
this.Interrupt({ passage: 'outside-inn', x: -1625, y: -18, height: 500 }),
this.Interrupt({ passage: 'outside-inn-ants', x: 160, y: 10, height: 500 }),
]);
this.Area('deserter-path', [
this.PropParallax({ texture: 'bg_parallax', offset: -100000, scale: 3, blur: true, mult: 0.6 }),
this.Prop({ texture: 'bg_innOutside', x: 793, y: 492, flip: true, offset: -10000 }),
this.Npc({ body: 'basicAnt', x: 1359, y: -16 }),
this.Poly({ verts: [-59,-116, -88,135, 832,168, 986,155, 1503,147, 1482,-188, 916,-124, 561,-97, -59,-116] }),
this.Interrupt({ passage: 'deserter-wall', x: -63, height: 500 }),
this.Interrupt({ passage: 'deserter', x: 1300, height: 500 }),
]);
this.Area('camp', [
this.Interrupt({ passage: 'camp-march' }),
]);
this.Area('camp-outlook', [
this.PropParallax({ texture: 'bg_stars', mult: 0.4, offset: -20000 }),
this.Prop({ texture: 'bg_camp', scale: 2, angle: -20, flip: true, x: -5000, y: 3419, offset: -10000 }),
this.Poly({ verts: [107,-200, -185,-83, -351,-56, -613,58] }),
this.Interrupt({ width: 1500, height: 1000, focus: { x: 0, y: -400 } }),
this.Goto({ area: 'camp', x: -1537, y: -12 }, { y: 100, width: 2000 }),
this.Goto({ area: 'camp', x: -1537, y: -12 }, { x: 147, y: -66, height: 500 }),
]);
this.Area('camp-outlook-cordy', [
this.PropParallax({ texture: 'bg_stars', mult: 0.4, offset: -20000 }),
this.Prop({ texture: 'bg_camp', scale: 2, angle: -20, flip: true, x: -5000, y: 3419, offset: -10000 }),
this.Interrupt({ width: 1500, height: 1000, focus: { x: -100, y: -300 } }),
]);
this.Area('camp-outlook-intro', [
this.PropParallax({ texture: 'bg_stars', mult: 0.4, offset: -20000 }),
this.Prop({ texture: 'bg_camp', scale: 2, angle: -20, flip: true, x: -5000, y: 3419, offset: -10000 }),
this.Poly({ verts: [107,-200, -185,-83, -351,-56, -613,58] }),
this.Interrupt({ passage: 'camp-outlook-intro', width: 1500, height: 1000, focus: { x: 0, y: -400 } }),
this.Goto({ area: 'camp', x: -1537, y: -12 }, { y: 100, width: 2000 }),
this.Goto({ area: 'camp', x: -1537, y: -12 }, { x: 147, y: -66, height: 500 }),
]);
this.outlooknpc = this.Npc({ x: -296, y: -2 });
this.outlooknpc.flipped=true;
this.Area('camp-outlook-event', [
this.PropParallax({ texture: 'bg_stars', mult: 0.4, offset: -20000 }),
this.Prop({ texture: 'bg_camp', scale: 2, angle: -20, flip: true, x: -5000, y: 3419, offset: -10000 }),
this.Poly({ verts: [107,-200, -185,-83, -351,-56, -613,58] }),
this.Interrupt({ passage: 'camp-outlook', width: 1500, height: 1000, focus: { x: 0, y: -200 } }),
this.Goto({ area: 'camp', x: -1537, y: -12 }, { y: 100, width: 2000 }),
this.Goto({ area: 'camp', x: -1537, y: -12 }, { x: 147, y: -66, height: 500 }),
this.outlooknpc,
]);
this.Area('town', [
this.Prop({ texture: 'bg_town', y: 334, offset: -10000 }),
this.Poly({ verts: [-439,-187, -639,-135, -705,-15, -614,205, -449,291, -170,324, 50,319, 395,302, 595,205, 673,76, 702,-88, 688,-185, 551,-223] }),
this.Poly({ verts: [448,-252, 382,-275, 174,-275] }),
this.Poly({ verts: [33,-278, -118,-288, -188,-298, -337,-239] }),
this.Goto({ area: 'town', x: 0, y: 0 }, { type: 'circle', x: -394, y: -211 }),
this.Goto({ area: 'town', x: 0, y: 0 }, { type: 'circle', x: 104, y: -294 }),
this.Goto({ area: 'town', x: 0, y: 0 }, { type: 'circle', x: 501, y: -253 }),
this.Prop({ texture: 'innTable1', x: -399, y: -57 }),
this.Prop({ texture: 'shadows', x: -399, y: -57+15, offset: -20, scale: 2, alpha: 0.5 }),
this.Block({ type: 'circle', x: -399, y: -57, radius: 10 }),
this.Prop({ texture: 'innTable2', x: 304, y: -107 }),
this.Prop({ texture: 'shadows', x: 304, y: -107+15, offset: -20, scale: 2, alpha: 0.5 }),
this.Block({ type: 'circle', x: 304, y: -107, radius: 10 }),
this.Npc({ passage: 'test-npc', x: 335, y: -134 }),
]);
this.campcordyguard = this.Npc({ passage: 'cordyceps-2-guard' });
this.Area('camp-cordy2', [
this.Prop({ texture: 'bg_camp', x: -458, y: 926, offset: -10000 }),
this.Poly({ verts: [-2049,-117, -2045,234, -1628,266, -1319,287, -1068,335, -876,317, -651,363, -467,348, -100,414, 191,449, 559,665, 1023,683, 1148,414, 1144,-694, 566,-707, 539,-548, 392,-283, 142,-255, -183,-278, -608,-234, -984,-203, -1127,-212, -1501,-208, -1803,-191, -2049,-117] }),
this.Prop({ texture: 'fireplace', x: 91, y: -78, offset: -30 }),
this.Block({ type: 'circle', x: 91, y: -78-35, radius: 35 }),
this.Interrupt({ passage: 'cordyceps-2-wall', x: -1765, y: 45, height: 1000 }),
this.Interrupt({ passage: 'cordyceps-2-wall', x: 915, y: -22, height: 1000 }),
this.Interrupt({ passage: 'cordyceps-2-wall', x: 657, y: -365, width: 500 }),
this.Interrupt({ passage: 'cordyceps-2-wall', x: 657, y: 524, width: 500 }),
this.campcordyguard,
...this.TentSmall({ x: 688, y: 249, flip: true }),
...this.TentMedium({ goto: { area: 'camp-cordy2-inside' }, x: -237, y: -69}),
// extra
...this.Wagon({ x: 516, y: -163 }),
...this.TentSmall({ x: -903, y: 139 }),
...this.TentSmall({ x: -1214, y: -90, flip: true }),
]);
this.cordycircle = [
...this.AntProp({ x: -101, y: -78 }),
...this.AntProp({ x: -73, y: -130 }),
...this.AntProp({ x: 125, y: -91, flip: true }),
...this.AntProp({ x: 97, y: -126, flip: true }),
];
this.Area('camp-cordy2-inside', [
this.Prop({ texture: 'bg_interior', y: -50, offset: -10000 }),
this.Poly({ verts: [0,20, 100,11, 159,-101, 92,-159, -83,-171, -124,-135, -51,19, 0,20] }),
this.Prop({ texture: 'cordyAntTied', x: 0, y: -141, alpha: 0.5, scale: 0.5 }),
...this.cordycircle,
this.Interrupt({ passage: 'cordyceps-2-inside', x: 0, y: -90, width: 500 }),
]);
this.Area('town-exile', [
this.Prop({ texture: 'bg_town', y: 334, offset: -10000 }),
this.Poly({ verts: [-439,-187, -639,-135, -705,-15, -614,205, -449,291, -170,324, 50,319, 395,302, 595,205, 673,76, 702,-88, 688,-185, 551,-223] }),
this.Poly({ verts: [448,-252, 382,-275, 174,-275] }),
this.Poly({ verts: [33,-278, -118,-288, -188,-298, -337,-239] }),
this.Interrupt({ passage: 'exile-refuse-1', type: 'circle', x: -394, y: -211 }),
this.Interrupt({ passage: 'exile-refuse-2', type: 'circle', x: 104, y: -294, focus: { x: 0, y: -400 } }),
this.Interrupt({ passage: 'exile-refuse-3', type: 'circle', x: 501, y: -253 }),
this.Interrupt({ passage: 'exile-exit', x: -30, y: 278, width: 1000 }),
this.Prop({ texture: 'innTable1', x: -399, y: -57 }),
this.Prop({ texture: 'shadows', x: -399, y: -57+15, offset: -20, scale: 2, alpha: 0.5 }),
this.Block({ type: 'circle', x: -399, y: -57, radius: 10 }),
this.Prop({ texture: 'innTable2', x: 304, y: -107 }),
this.Prop({ texture: 'shadows', x: 304, y: -107+15, offset: -20, scale: 2, alpha: 0.5 }),
this.Block({ type: 'circle', x: 304, y: -107, radius: 10 }),
]);
this.Area('town-family', [
this.Prop({ texture: 'bg_town', y: 334, offset: -10000 }),
this.Poly({ verts: [-439,-187, -639,-135, -705,-15, -614,205, -449,291, -170,324, 50,319, 395,302, 595,205, 673,76, 702,-88, 688,-185, 551,-223] }),
this.Poly({ verts: [448,-252, 382,-275, 174,-275] }),
this.Poly({ verts: [33,-278, -118,-288, -188,-298, -337,-239] }),
this.Interrupt({ passage: 'family-wall', type: 'circle', x: -394, y: -211 }),
this.Interrupt({ passage: 'family-exit', type: 'circle', x: 104, y: -294, focus: { x: 0, y: -400 } }),
this.Interrupt({ passage: 'family-exit', type: 'circle', x: 501, y: -253 }),
this.Prop({ texture: 'innTable1', x: -399, y: -57 }),
this.Prop({ texture: 'shadows', x: -399, y: -57+15, offset: -20, scale: 2, alpha: 0.5 }),
this.Block({ type: 'circle', x: -399, y: -57, radius: 10 }),
this.Prop({ texture: 'innTable2', x: 304, y: -107 }),
this.Prop({ texture: 'shadows', x: 304, y: -107+15, offset: -20, scale: 2, alpha: 0.5 }),
this.Block({ type: 'circle', x: 304, y: -107, radius: 10 }),
this.Npc({ passage: 'family-role-1', x: -405, y: -57 }),
this.Npc({ passage: 'family-role-2', x: 290, y: 50, roam: 100 }),
this.Npc({ passage: 'family-role-3', x: 410, y: 150, roam: 100 }),
]);
const frogEnd = this.Interrupt({ passage: 'frog-end', x: 1982, y: -915, width: 1000 });
frogEnd.body.rotate(Math.PI/4);
this.frogBridgeFg = this.Prop({ texture: 'fg_frog', x: 1249, y: -55, offset: -60 });
this.frog = this.Prop({ texture: 'frog', x: 937, y: -179, offset: -200, freq: 1/600 });
this.frog.spr.alpha = 0;
const frogBridge = this.Interrupt({ passage: 'frog-bridge', x: 722, y: -238, focus: { x: 150, y: -200 }, width: 360 });
frogBridge.body.rotate(0.54);
this.Area('frog', [
this.PropParallax({ texture: 'bg_parallax', offset: -100000, scale: 3, blur: true, mult: 0.6 }),
this.Prop({ texture: 'bg_frog', x: 1041, y: 689, offset: -10000 }),
this.frogBridgeFg,
this.frog,
this.Poly({ verts: [-86,-202, -88,171, 124,152, 205,81, 302,96, 358,133, 565,126, 870,46, 949,-40, 1002,-134, 1038,-249, 838,-113, 819,-160, 908,-163, 1632,-690, 1655,-728, 1679,-700, 1760,-640, 1868,-690, 2178,-889, 1915,-1081, 1850,-1016, 1623,-875, 1481,-828, 1430,-815, 1398,-818, 583,-347, 579,-311, 544,-267, 319,-220, -86,-202] }),
frogEnd,
this.Interrupt({ passage: 'frog-wall', x: -84, y: 174, height: 1000 }),
frogBridge,
]);
this.Area('test', [
// bg
this.PropParallax({ texture: 'bg_parallax', offset: -1000000, scale: 3, blur: true, mult: 0.6 }),
this.PropParallax({ texture: 'bg_parallax', offset: -100000, scale: 0.5, blur: true, mult: 0.2 }),
this.Prop({ texture: 'bg_parallax', x: -200, y: 700, offset: -10000 }),
this.Text('physics', { x: 423, y: 78 }),
this.Block({ x: 200, y: 0, width: 50, height: 100 }),
this.Block({ type: 'circle', x: 300, y: 0, radius: 50 }),
this.Poly({ verts: [400,0, 600,-50, 580,200, 425,150] }),
this.Text('static prop', { x: 74, y: -163 }),
this.Prop({ texture: 'error', x: 100, y: -158 }),
this.Text('animated props', { x: 296, y: -163 }),
this.Prop({ texture: 'basicAntIdle', x: 284, y: -128 }),
this.Prop({ texture: 'basicAntIdle', x: 290, y: -118 }),
this.Prop({ texture: 'basicAntRun', x: 300, y: -138 }),
...Queen({ x: 905, y: 469, passage: 'test-npc' }),
this.Text('npcs', { x: 340, y: 434 }),
this.Npc({ x: 302, y: 407 }),
this.Npc({ passage: 'test-npc', x: 342, y: 407 }),
this.Npc({ body: 'childAnt', passage: 'test-npc', x: 442, y: 407, roam: 100, scale: 0.6 }),
this.Text('gotos', { x: -289, y: -61 }),
this.Goto({ area: 'test-sub' }, { x: -289, y: 0 }),
this.Goto({ area: 'test-sub', y: -100 }, { x: -289, y: 100, type: 'circle' }),
this.Text('interrupts', { x: -450, y: -61 }),
this.Interrupt({ x: -450, y: 0, passage: 'test-npc' }),
this.Interrupt({ x: -450, y: 100, type: 'circle', passage: 'test-npc' }),
// helper fn
TestSpecialNpc({ x: -367, y: 411, passage: 'test-npc' }),
// spread procedural
...new Array(50).fill(0).map(() => this.Npc({ passage: 'test-npc', x: (Math.random()-0.5)*300, y: (Math.random()-0.5)*300+400 })),
]);
this.Area('test-sub', [
this.Npc({ passage: 'test-npc', x: 0, y: 50 }),
this.Goto({ area: 'test' }, { x: 0, y: 100, width: 300 }),
]);
// start
this.started=true;
this.scene.goto({ area: 'march' });
requestAnimationFrame(() => {
this.scrim(0.5, 3000);
this.tween(this.scene.dialogue.sprBg, 'alpha', 1, 5000, 0);
});
>>
<<endif>>
P: We Follow The Fickle Path
[[Begin]]
[[Begin (skip intro)]]
[[Language>language select]]
[[Credits]]
[[Content warnings]]
<<if this.debug>>[[debug menu]]<<endif>>
::Credits
P: Made by Sean, Michael, and IAN of SweetHeart Squad.
Spanish (Latin America) translation by David Pérez.
[[More games|window.open('https://sweetheartsquad.itch.io', '_blank')]]
[[Back|this.back()]]
::close
this should never render
::talk
talk
::The End
<<do
this.howler = this.musicSynced('');
this.tween(this.scene.border.display.container, 'alpha', 0, 5000);
>>
P: We Follow The Fickle Path
Made by Sean, IAN, and Michael of SweetHeart Squad.
Spanish (Latin America) translation by David Pérez.
[[Restart|this.restart()]]
[[More games|window.open('https://sweetheartsquad.itch.io', '_blank')]]
::debug menu
<<do
this.howler = this.musicSynced('bgm_normal');
this.scene.border.display.container.alpha=1;
this.scene.strand.passages['area warp'] = { title: 'area warp', body: Object.keys(this.scene.areas).filter(i => i !== 'root').map(i => '[['+i+'|this.scene.goto({ area: "'+i+'" }); this.goto("close")]]').concat('[[back|this.back()]]').join('\n') };
>>
[[passage select>passage select]]
[[area warp]]
[[language select]]
[[toggle debugPhysics|window.debugPhysics=!window.debugPhysics]]
[[draw walls|
const canvas = window.game.app.renderer.context.gl.canvas;
const verts = [];
let poly;
const onClick = (event) => {
const rect = event.currentTarget.getBoundingClientRect();
let x = event.clientX - rect.left;
let y = event.clientY - rect.top;
const p = this.scene.camera.display.container.toLocal({ x, y });
x = Math.round(p.x);
y = Math.round(p.y);
verts.push([x,y]);
if (poly) {
this.destroy(poly);
}
poly = this.Poly({ verts: verts.flat() });
};
const onContextMenu = (event) => {
event.preventDefault();
canvas.removeEventListener('click', onClick);
canvas.removeEventListener('contextmenu', onContextMenu);
canvas.parentElement.style.cursor = 'inherit';
if (poly) {
console.log(`this.Poly({ verts: [${verts.map(i => i.join(',')).join(', ')}] }),`);
this.scene.drop(poly);
}
};
requestAnimationFrame(() => {
canvas.addEventListener('click', onClick);
canvas.addEventListener('contextmenu', onContextMenu);
});
canvas.parentElement.style.cursor = 'crosshair';
this.goto('close');
]]
[[teleport|
const canvas = window.game.app.renderer.context.gl.canvas;
const verts = [];
let poly;
const onClick = (event) => {
const rect = event.currentTarget.getBoundingClientRect();
let x = event.clientX - rect.left;
let y = event.clientY - rect.top;
const p = this.scene.camera.display.container.toLocal({ x, y });
this.scene.player.setPosition(p.x, p.y);
};
const onContextMenu = (event) => {
event.preventDefault();
canvas.removeEventListener('click', onClick);
canvas.removeEventListener('contextmenu', onContextMenu);
canvas.parentElement.style.cursor = 'inherit';
};
requestAnimationFrame(() => {
canvas.addEventListener('click', onClick);
canvas.addEventListener('contextmenu', onContextMenu);
});
canvas.parentElement.style.cursor = 'crosshair';
this.goto('close');
]]
[[close]]
[[back|this.back()]]
::language select
[[en|this.setSource(game.app.loader.resources['main-en'].data);this.back();]]
[[es-419|this.setSource(game.app.loader.resources['main-es-419'].data);this.back();]]
[[fr|this.setSource(game.app.loader.resources['main-fr'].data);this.back();]]
::test-npc
"Hello I am an NPC."
>
P: "And now I am the player."
>
P: I can monologue too.
[[leave>close]]
::Content warnings
P: This is a story about bugs.
It deals with themes of identity and autonomy, death and disaster, and family and faith.
[[Back|this.back()]]
::Begin (skip intro)
<<do
this.howler = this.musicSynced('bgm_normal');
this.counti = 0;
this.countwe = 0;
this.tween(this.scene.border.display.container, 'alpha', 1, 5000);
this.goto('march');
>>
::Begin
<<do
this.howler = this.musicSynced('bgm_normal');
this.counti = 0;
this.countwe = 0;
>>
P: Doubt comes to you so easily when you're bored.
>
<<do this.tween(this.scene.border.display.container, 'alpha', 1, 5000);>>
P: Your mind wanders. You think about things. You ask yourself questions, and come up with answers that are yours and yours alone.
>
<<do this.scrim(0.5, 10000)>>
P: Sometimes I feel like this dubious boredom is itself just another expression of our shared existence and purpose.
>
P: We all march along the limb of the same tree, we all get caught up in our heads with the same thoughts, we all wonder if the others do the same.
>
P: Most of the time I think that I am being specifically punished with this burden, and that my sisters would not understand were I to share it aloud.
>
P: I doubt myself.
>
P: So I am briefly glad to be interrupted by someone shouting my name.
>
"Sister Twenty, look out!"
[[Freeze]]
[[Duck]]
[[Dodge]]
::Freeze
<<do this.scrim(1, 100)>>
P: I freeze in place. A moment later, my vision is flooded by a great branch collapsing down mere inches in front of me.
[[Oh no.>begin2]]
::Duck
<<do this.scrim(1, 100)>>
P: I fall to the ground instinctively. As soon as I do, I hear the crash of a great branch collapsing down mere inches in front of me, and cling on for dear life.
[[Oh no.>begin2]]
::Dodge
<<do this.scrim(1, 100)>>
P: I leap backwards on instinct, barreling into the one who called out, Sister Ten-and-nine. The two of us tumble down just as I hear the crash of a great branch collapsing into the path ahead.
[[Oh no.>begin2]]
::begin2
P: All at once there is a panic. Sisters are screaming, reaching out, running. The fallen limb weighs heavy on the branch we walk. It dips, and I struggle to keep my balance.
>
P: It creaks and groans, and unleashes a horrible crack as something gives.
>
P: The world rushes away. I'm falling. This is it.
[[We're going to die.|++this.countwe;this.goto('begin3')]]
[[I'm sorry Mother.|++this.counti;this.goto('begin3')]]
[[I don't want to die.|++this.counti;this.goto('begin3')]]
::begin3
P: But I'm wrong.
>
P: I realize I'm being flung upwards. The branch snapped in front of me, and the leftover stump is recoiling. I need to hold on. I need to hold on.
>I need to hold on!
P: I grip as tightly as I can. I bite into the bark: Anything to stay put.
>
P: There's a jolt, a painful whiplash that wrenches every joint in my body.
>
P: But I hold.
>
P: My head aches. The canopy comes back into focus.
>
P: It starts to rain.
<<do this.scene.goto({ area: 'intro' });>>
[[>close]]
::intro-wall
<<do this.scene.player.walkBy(50,0)>>
P: Can't trust what's left to be stable, I need to get back.
[[>close]]
::intro-panic
<<do this.gameObject.line = this.gameObject.line || this.shuffle([
'"Half the retinue was in front of us... all gone..."',
'"Mother... where is the Queen Mother!?"',
'"Sisters... our sisters..."',
'"No... this cannot be happening."',
'"They fell. We can\'t help them now..."',
'"We were too late..."',
'"No!!"',
'"Please, leave us alone..."',
'"Mother will know what to do. Mother always knows what to do."',
'"We need to find shelter. We can\'t stay out like this."',
'"This can\'t be happening. This can\'t be happening."',
'"Sister! We\'re glad you\'re safe, please help the others!"',
'"Sister..."',
'P: She\'s panicked, and doesn\'t listen to me.',
'P: She\'s busy helping the others.',
'P: I shouldn\'t distract her.',
'P: I want to tell her it will be okay, but it won\'t be.',
])[0]>>
<<print this.gameObject.line>>
[[>close]]
::intro-end
<<do this.destroy(this.gameObject)>>
P: It's a nightmare.
Sisters call out, trying to make sense of it all:
>
"How many fell?"
"We must turn back!"
"Where is Mother?!"
"Wait, there's her retinue..."
[[Mother!>mother-speech]]
::mother-speech
<<do this.scrim(1, 100)>>
P: We all stop. There is no need for anyone to shush another in her presence.
The rain itself quiets as if it senses our anticipation.
>
P: Queen Mother One and Many Oecophylla is going to speak.
>
<<do this.show('queenIdle')>>
voiceQueen
"..."
>
"Daughters. Sisters."
>Mother!
"We see fear in our faces."
[[We are scared!|++this.countwe;this.goto('mother-speech2')]]
[[I don't want to die!|++this.counti;this.goto('mother-speech2')]]
::mother-speech2
"We smell grief in the air."
[[We are crying!|++this.countwe;this.goto('mother-speech3')]]
[[I cannot continue!|++this.counti;this.goto('mother-speech3')]]
::mother-speech3
"Do not worry."
[[We should not worry.|++this.countwe;this.goto('mother-speech4')]]
[[How could I not?|++this.counti;this.goto('mother-speech4')]]
::mother-speech4
"Do not weep for the sisters we've lost."
[[We should not weep.|++this.countwe;this.goto('mother-speech5')]]
[[My cries go unanswered.|++this.counti;this.goto('mother-speech5')]]
::mother-speech5
"Our daughters, our sisters, are not gone."
"Yes, our numbers are lessened, but look around."
[[We see.|++this.countwe;this.goto('mother-speech6')]]
[[I see.|++this.counti;this.goto('mother-speech6')]]
::mother-speech6
"Listen."
>
"We are surrounded by our family."
"Our strength."
"Our gift and our blessing to ourselves and each other."
>Our family...
P: The sister to my left reaches out, clasps hands in mine.
>In ours.
voiceQueen
"A sister is One, and one may be lost."
"A sister of Many, will always have sisters."
>Our sisters...
"Our sisters of Many survive."
>
"So too will each One."
>
"..."
>
<<do this.show('')>>
P: Mother... Her words trace themselves through our sisters and our self.
[[We have faith.|++this.countwe;this.goto('mother-speech7')]]
[[I really do.|++this.counti;this.goto('mother-speech7')]]
::mother-speech7
P: The feeling passes in waves. Our sisters cheer, and we join with them. I can't help but notice how much quieter the crowd is than when it set out.
Our hopes are brightened. My worry sets itself deep in my stomach.
>
P: But there's ground to cover.
[[So we march.>march]]
::march
<<do
this.musicSynced('bgm_march');
this.march = (this.march || 0) + 1;
if (!this.passages['march-'+this.march]) {
this.march = 2;
}
if (!this.marchqs1 || !this.marchqs1.length < 3) {
this.marchqs1 = this.shuffle([
'"Mother is safe. That is what matters."',
'"Our sisters are strong."',
'"We are strong. We are strong."',
'"How long has it been since we set out?"',
'"Our legs ache..."',
'"Where will we sleep tonight?"',
'"Has anyone seen Sister Thirty-and-four?"',
'"We saw them fall..."',
'"Has Sister Superior said anything?"',
'"There is no time to waste."',
'"We must. We simply must."',
'"Luck will not help us."',
'"We must help ourselves."',
'"Our Mother will guide us."',
'"We will follow the path."',
'"Left, right..."',
'"Stay safe."',
'"All gone..."',
'"Look at the trees..."',
'"We have no reason to fear."',
'"How do the little ones fare?"',
'"How many have fallen?"',
'"How many still stand?"',
'"We will not stop."',
'"The path is long."',
'"The path is hard."',
'"The path is ours."',
]);
}
if (!this.marchqs2 || !this.marchqs2.length < 3) {
this.marchqs2 = this.shuffle([
'"Haven\'t we been here before?"',
'"Where are we?"',
'"Are we still on the path?"',
'"Is Mother alright?"',
'"When can we rest?"',
'"We\'re tired..."',
'"We\'re hungry..."',
'"We\'re sore..."',
'"We\'re thirsty..."',
'"This is too much... too much..."',
'"What are we going to do?"',
'"Leave us alone."',
'"We need to."',
'"Where is the path taking us?"',
'"Should we stop?"',
'"We cannot stop."',
'"We must go on."',
'"So many sisters..."',
'"We are still sisters."',
'"We are still Many."',
'"Have we gone too far?"',
'"Must we go further?"',
'"Mother..."',
'"Sister..."',
'"Will we see them again?"',
'"Hold our hands, Sister."',
'"Do not fear, Sister."',
'"Sister, walk with me."',
'"The path is too long."',
'"The path is too hard."',
'"Is this truly the path?"',
]);
}
if (!this.marchqs3 || !this.marchqs3.length < 3) {
this.marchqs3 = this.shuffle([
'"We must be on the path."',
'"Do you smell that?"',
'"This must be the path."',
'"The path will not let us down."',
'"We will follow the path."',
'"It smells nice..."',
'"Our path is clear."',
'"There is no time to lose."',
'"We must hurry."',
'"Is our journey ending?"',
'"We will see this through."',
'"The trees... The leaves..."',
'"Our home..."',
'"Is this it?"',
'"Can it be true?"',
'"We must believe."',
'"We cannot lose faith."',
'"We will."',
]);
}
// sets up progression
// march events will go to `${name}-march`,
// and can be "ended" by going to `march` again
if(!this.marchEvents || !this.marchEvents.length) {
let pool = [
...new Array(4).fill('feeding'),
...new Array(5).fill('camp'),
'cordyceps',
'inn',
'frog',
'deserter',
];
const events = [];
while(events.length < 8 && pool.length) {
pool = this.shuffle(pool);
if (pool[pool.length-1] === events[events.length-1]) {
continue;
}
events.push(pool.pop());
}
// guarantee both cordyceps events
if (events.includes('cordyceps')) {
const idx = events.indexOf('cordyceps');
if (idx > events.length/2) {
events[1] = 'cordyceps';
} else {
events[events.length-2] = 'cordyceps';
}
}
this.marchEvents = events;
this.marchEvents.push('ending');
}
this.marchEvent = this.marchEvents.shift();
this.scrim(1, 1000);
setTimeout(() => {
this.scene.goto({ area: 'march' });
setTimeout(() => {
this.scrim(0.5, 10000);
this.goto('march-'+this.march);
}, 100);
}, 1000);
>>
::march-1
P: ...
>
P: No one questions it.
>
P: The tension is palpable, but we follow the path.
[[>march-end]]
::march-2
P: ...
>
P: The mood is strange as we walk today.
>
P: Sisters buzz in idle chatter, they speak their minds without expecting answers.
>
<<print this.marchqs1.pop()>>
>
<<print this.marchqs1.pop()>>
>
<<print this.marchqs1.pop()>>
[["We just need to keep going."|++this.countwe;this.goto('march-end')]]
[["I will make it through this."|++this.counti;this.goto('march-end')]]
[["This is hopeless.">march-end]]
::march-3
P: ...
>
P: We keep a steady pace, feet moving, minds bustling.
>
<<print this.marchqs1.pop()>>
>
<<print this.marchqs1.pop()>>
>
<<print this.marchqs1.pop()>>
[["We will make it."|++this.countwe;this.goto('march-end')]]
[["I know I can do it."|++this.counti;this.goto('march-end')]]
[["This is a waste of time.">march-end]]
::march-4
P: ...
>
P: Our stomachs growl, but our legs keep moving.
>
<<print this.marchqs2.pop()>>
>
<<print this.marchqs2.pop()>>
>
<<print this.marchqs2.pop()>>
[["Is this really what we should be doing?"|++this.countwe;this.goto('march-end')]]
[["Can't I do more to help?"|++this.counti;this.goto('march-end')]]
[["Why did this happen?">march-end]]
::march-5
P: ...
>
P: The canopy rustles overhead.
>
<<print this.marchqs2.pop()>>
>
<<print this.marchqs2.pop()>>
>
<<print this.marchqs2.pop()>>
[["Will we ever find what we're looking for?"|++this.countwe;this.goto('march-end')]]
[["Is this my fault?"|++this.counti;this.goto('march-end')]]
[["Where is the path?">march-end]]
::march-6
P: ...
>
P: The scouts find a few fresh leaves, and we take what we can.
>
P: It's not enough for a nest, but it is hopefully a good sign.
>
<<print this.marchqs1.pop()>>
>
<<print this.marchqs1.pop()>>
>
<<print this.marchqs1.pop()>>
[["Can we go on like this?"|++this.countwe;this.goto('march-end')]]
[["What if I'm wrong?"|++this.counti;this.goto('march-end')]]
[["It doesn't matter, none of it.">march-end]]
::march-7
P: ...
>
P: The air is humid. The bark is light underfoot.
>
<<print this.marchqs1.pop()>>
>
<<print this.marchqs1.pop()>>
>
<<print this.marchqs1.pop()>>
[["Why haven't we stopped?"|++this.countwe;this.goto('march-end')]]
[["Should I bother?"|++this.counti;this.goto('march-end')]]
[["No one will listen.">march-end]]
::march-8
P: ...
>
P: There are new scents in the air.
>
P: Strong, and redolent.
>
<<print this.marchqs3.pop()>>
>
<<print this.marchqs3.pop()>>
>
<<print this.marchqs3.pop()>>
[["Our path must be coming to an end."|++this.countwe;this.goto('march-end')]]
[["I can't believe it."|++this.counti;this.goto('march-end')]]
[["This must be it.">march-end]]
::march-9
P: ...
>
P: The sun shines through the leaves above, speckling the path in greens and golds.
>
<<print this.marchqs3.pop()>>
>
<<print this.marchqs3.pop()>>