-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnewton.js
1323 lines (1148 loc) · 22.9 KB
/
newton.js
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
title Newton's Crates
author Andrey Shevchuk
homepage shevchuk.net
background_color darkbrown
text_color lightgrey
noaction
again_interval 0.1
========
OBJECTS
========
Background
lightgrey
00000
00000
00000
00000
00000
Target
DarkBlue
.....
.000.
.0.0.
.000.
.....
Wall
BROWN darkbrown
11111
11111
11111
11111
11111
Player
Grey Orange White Brown Black
.000.
.010.
30303
.333.
.4.4.
Crate
orange Yellow
00000
00000
00000
00000
00000
Finalist0
Grey Orange White Brown Black
.000.
.010.
30303
.333.
.4.4.
Finalist1
Grey Orange White Brown Black
.000.
.010.
30303
.333.
.4.4.
Finalist2
Grey Orange White Brown Black
.000.
.010.
30303
.333.
.4.4.
Genius
Grey Orange White Brown Black
.000.
.010.
30303
.333.
.4.4.
Winner001
Grey Orange White Brown Black
.000.
.010.
30303
.333.
.4.4.
Winner002
Grey Orange White Brown Black
.000.
.010.
30303
.333.
.4.4.
Winner003
Grey Orange White Brown Black
.000.
.0103
3030.
.433.
...4.
Winner004
Grey Orange White Brown Black
.000.
3010.
.0303
.334.
.4...
Winner005
Grey Orange White Brown Black
.000.
.0103
3030.
.433.
...4.
Winner006
Grey Orange White Brown Black
.000.
3010.
.0303
.334.
.4...
Winner007
Grey Orange White Brown Black
.000.
.0103
3030.
.433.
...4.
Winner008
Grey Orange White Brown Black
.000.
.010.
30303
.333.
.4.4.
m1
transparent
m2
transparent
m3
transparent
m4
transparent
m5
transparent
m6
transparent
Winner101
Grey Orange White Brown Black
.000.
.010.
30303
.333.
.4.4.
Winner102
Grey Orange White Brown Black
.000.
.010.
30303
.333.
.4.4.
Winner103
Grey Orange White Brown Black
.000.
.0103
3030.
.333.
.4.4.
Winner104
Grey Orange White Brown Black
.000.
.013.
3033.
.333.
.4.4.
Winner105
Grey Orange White Brown Black
.000.
.030.
3033.
.333.
.4.4.
Winner106
Grey Orange White Brown Black
.000.
.013.
3033.
.333.
.4.4.
Winner107
Grey Orange White Brown Black
.000.
.0103
3030.
.333.
.4.4.
Winner108
Grey Orange White Brown Black
.000.
.010.
30303
.333.
.4.4.
Winner109
Grey Orange White Brown Black
.000.
.010.
30303
.333.
.4.4.
Winner201
Grey Orange White Brown Black
.000.
.010.
30303
.333.
.4.4.
Winner202
Grey Orange White Brown Black
.000.
.010.
30303
.333.
.4.4.
Winner203
Grey Orange White Brown Black
.000.
.0103
3030.
.333.
.4.4.
Winner204
Grey Orange White Brown Black
.....
.0003
3000.
.030.
.4.4.
Winner205
Grey Orange White Brown Black
.000.
.0103
3030.
.333.
.4.4.
Winner206
Grey Orange White Brown Black
.....
.0003
3000.
.030.
.4.4.
Winner207
Grey Orange White Brown Black
.000.
.0103
3030.
.333.
.4.4.
Winner208
Grey Orange White Brown Black
.....
.0003
3000.
.030.
.4.4.
Winner209
Grey Orange White Brown Black
.000.
.0103
3030.
.333.
.4.4.
Winner210
Grey Orange White Brown Black
.....
.0003
3000.
.030.
.4.4.
Winner211
Grey Orange White Brown Black
.000.
.010.
30303
.333.
.4.4.
Winner301
Grey Orange White Brown Black
.000.
.010.
30303
.333.
.4.4.
Winner302
Grey Orange White Brown Black
.000.
.010.
30303
.333.
.4.4.
Winner303
Grey Orange White Brown Black
.000.
.010.
30303
.343.
.4...
Winner304
Grey Orange White Brown Black
.000.
.010.
30303
.334.
.4...
Winner305
Grey Orange White Brown Black
.000.
.010.
30303
.333.
.4..4
Winner306
Grey Orange White Brown Black
.000.
3010.
.0303
.333.
.4..4
Winner307
Grey Orange White Brown Black
.000.
30103
.030.
.333.
.4..4
Winner308
Grey Orange White Brown Black DarkBrown
.000.
3010.
.030.
.3335
.4..4
Winner309
Grey Orange White Brown Black DarkBrown
.000.
3010.
.030.
.3335
.4..4
(Hiding amongst the winners, a fruit)
Apple
Green Red Transparent DarkRed
22200
21032
11133
11133
21332
AppleCore
Green Red Transparent DarkRed White
22200
21032
22422
22342
21332
Winner401
Grey Orange White Brown Black
.000.
.010.
30303
.333.
.4.4.
Winner402
Grey Orange White Brown Black
.000.
.010.
30303
.333.
.4.4.
Winner403
Grey Orange White Brown Black
.000.
30103
.030.
.333.
.4.4.
Winner404
Grey Orange White Brown Black
.000.
.313.
.333.
.333.
.4.4.
Winner405
Grey Orange White Brown Black
.000.
30103
.030.
.333.
.4.4.
Winner406
Grey Orange White Brown Black
.000.
.313.
.333.
.333.
.4.4.
Winner407
Grey Orange White Brown Black
.000.
30103
.030.
.333.
.4.4.
Winner408
Grey Orange White Brown Black
.000.
.010.
30303
.333.
.4.4.
Winner409
Grey Orange White Brown Black
.000.
.010.
30303
.333.
.4.4.
Winner501
Grey Orange White Brown Black
.000.
.010.
30303
.333.
.4.4.
Winner502
Grey Orange White Brown Black
.000.
.010.
30303
.333.
.4.4.
Winner503
Grey Orange White Brown Black
.....
.000.
30103
.030.
.4.4.
Winner504
Grey Orange White Brown Black DarkGrey
.....
.000.
30003
.030.
.5.5.
Winner505
Grey Orange White Brown Black DarkGrey
.....
.000.
30003
.000.
.5.5.
Winner506
Grey Orange White Brown Black DarkGrey
.....
30003
.000.
.000.
.5.5.
Winner507
Grey Orange White Brown Black DarkGrey
.....
30003
.000.
.000.
.5.5.
Winner508
Grey Orange White Brown Black DarkGrey
.....
30003
.000.
.000.
.5.5.
Winner509
Grey Orange White Brown Black DarkGrey
.....
30003
.000.
.000.
.5.5.
wait0
transparent
wait1
transparent
wait2
transparent
wait3
transparent
wait4
transparent
wait5
transparent
Cloud
green (as usual)
.....
.....
.....
.....
.....
clearsky1
transparent yellow
clearsky2
transparent yellow
clearsky3
transparent yellow
fapple0
Green #9a1f2a Transparent DarkRed
22200
21032
11133
11133
21332
fapple1
#2a6308 DarkRed Transparent DarkRed
22002
21100
11113
11133
23332
fapple2
#59a72a Red Transparent Red
22202
21032
11133
11333
21332
fapple3
#32720C #9a1f2a Transparent #9a1f2a
00222
21032
11133
11133
23332
squashUL
Green Red Transparent DarkRed
11122
12222
22222
22222
22222
squashUR
Green Red Transparent Red
22333
22223
22222
22222
22222
squashDL
Green Red Transparent DarkRed
22222
22222
22222
22222
12222
squashDR
Green Red Transparent Red
22222
22222
22222
22223
22233
fappleg
#29580d #71ae4c Transparent #50723b
22200
21032
11133
11133
21332
squashgU
#50723b Red Transparent DarkRed
20022
22222
22222
22222
22222
squashgR
#29580d #71ae4c Transparent #50723b
22222
22222
22222
22222
22223
squashgL
#29580d #71ae4c Transparent #50723b
22222
22222
22222
22222
32222
squashgD
#29580d #71ae4c Transparent #50723b
22222
22222
22222
22222
32222
squashU
transparent
squashR
transparent
squashL
transparent
squashD
transparent
spaace
blue
.....
.....
.....
.....
.....
zCrate
Orange Yellow
00000
0...0
0.0.0
0...0
00000
lastCrateOnTarget
Red Yellow
00000
00000
00000
00000
00000
lastTarget
transparent
yeaCrate
Orange Yellow
00000
0...0
0.0.0
0...0
00000
=======
LEGEND
=======
. = Background
# = Wall
P = Player
* = Crate
z = zCrate
0 = Crate and Target
@ = zCrate and Target
o = Target
a = Apple
c = AppleCore
1 = m1 and Apple and Crate
2 = m2 and Apple
3 = m3 and Apple and Crate
4 = m4 and Apple and Crate
5 = m5 and Apple and Crate
6 = m6 and Apple and Crate
y = cloud
, = spaace
g = lastTarget
h = lastTarget and Crate
Inertial = Crate or zCrate or Wall or lastCrateOnTarget
Mumbling = m1 or m2 or m3 or m4 or m5 or m6
Clearsky = clearsky1 or clearsky2 or clearsky3
Fapple = fapple0 or fapple1 or fapple2 or fapple3
Fapples = Fapple or fappleg
Finalists = Finalist0 or Finalist1 or Finalist2
Players = Player or Finalists or Genius
Squashing = fapple or Wall or fappleg or lastCrateOnTarget
WaitFrames = wait0 or wait1 or wait2 or wait3 or wait4 or wait5
WinAnimationStartFrame = Winner001 or Winner101 or Winner201 or Winner301 or Winner401 or Winner501
WinnerFrames = Winner001 or Winner002 or Winner003 or Winner004 or Winner005 or Winner006 or Winner007 or Winner008 or Winner101 or Winner102 or Winner103 or Winner104 or Winner105 or Winner106 or Winner107 or Winner108 or Winner109 or Winner201 or Winner202 or Winner203 or Winner204 or Winner205 or Winner206 or Winner207 or Winner208 or Winner209 or Winner210 or Winner211 or Winner301 or Winner302 or Winner303 or Winner304 or Winner305 or Winner306 or Winner307 or Winner308 or Winner309 or Winner401 or Winner402 or Winner403 or Winner404 or Winner405 or Winner406 or Winner407 or Winner408 or Winner409 or Winner501 or Winner502 or Winner503 or Winner504 or Winner505 or Winner506 or Winner507 or Winner508 or Winner509
=======
SOUNDS
=======
Inertial MOVE 62522307 (66976107) (36772507) (36718107)
(Player Move 61661707) (too repetitive on long runs)
sfx0 60497100 (zCrate moves on target)
(sfx1 (58358104) (16763304) (bumping into a wall))
sfx1 17123907 (green)
sfx2 74112904
sfx3 60342907
sfx5 47189907
sfx6 68393107
sfx4 21039704 (wall)
sfx10 70198308
sfx7 65707900 (Level Complete)
Undo 54083907
Restart 5315306
sfx9 94701308 (30980508) (16825502) (apple!)
sfx8 67172908 (eurika)
================
COLLISIONLAYERS
================
Background
squashUL
squashUR
squashDL
squashDR
squashgU
squashgD
squashgL
squashgR
squashU
squashL
squashD
squashR, WaitFrames, Mumbling
Target, Apple, AppleCore, cloud, Clearsky, spaace, lastTarget
Players, Inertial, yeaCrate, WinnerFrames, fapples
======
RULES
======
(The actual rules of the game)
[ > Player | Inertial ] -> [ > Player | > Inertial ]
[ > Inertial | Inertial ] -> [ Inertial | > Inertial ]
[ > Wall ] -> [ Wall ]
[ > zCrate | Target ] -> [ > zCrate | Target ] sfx0
(Win conditions, convoluted for the purposes of animation)
late [ zCrate Target ] -> [ yeaCrate Target ]
late [ yeaCrate ][ zCrate ] -> [ zCrate ][ zCrate ]
late [ yeaCrate ][Player] -> [yeaCrate][ wait0 random WinAnimationStartFrame ] sfx7
(Win animations)
late [wait4] -> [wait5] again
late [wait3] -> [wait4] again
late [wait2] -> [wait3] again
late [wait1] -> [wait2] again
late [wait0] -> [wait1] again
late [ Winner509 ] -> Win
late [ Winner508 ][wait3] -> [ Winner509 ][wait0] again
late [ Winner507 ][wait3] -> [ Winner508 ][wait0] again
late [ Winner506 ][wait3] -> [ Winner507 ][wait0] again
late [ Winner505 ][wait3] -> [ Winner506 ][wait0] again
late [ Winner504 ][wait3] -> [ Winner505 ][wait0] again
late [ Winner503 ][wait3] -> [ Winner504 ][wait0] again
late [ Winner502 ][wait3] -> [ Winner503 ][wait0] again
late [ Winner501 ][wait3] -> [ Winner502 ][wait0] again
late [ Winner409 ] -> Win
late [ Winner408 ][wait3] -> [ Winner409 ][wait0] again
late [ Winner407 ][wait3] -> [ Winner408 ][wait0] again
late [ Winner406 ][wait3] -> [ Winner407 ][wait0] again
late [ Winner405 ][wait3] -> [ Winner406 ][wait0] again
late [ Winner404 ][wait3] -> [ Winner405 ][wait0] again
late [ Winner403 ][wait3] -> [ Winner404 ][wait0] again
late [ Winner402 ][wait3] -> [ Winner403 ][wait0] again
late [ Winner401 ][wait3] -> [ Winner402 ][wait0] again
late [ Winner309 ] -> Win
late [ Winner308 ][wait3] -> [ Winner309 ][wait0] again
late [ Winner307 ][wait3] -> [ Winner308 ][wait0] again
late [ Winner306 ][wait3] -> [ Winner307 ][wait0] again
late [ Winner305 ][wait3] -> [ Winner306 ][wait0] again
late [ Winner304 ][wait3] -> [ Winner305 ][wait0] again
late [ Winner303 ][wait3] -> [ Winner304 ][wait0] again
late [ Winner302 ][wait3] -> [ Winner303 ][wait0] again
late [ Winner301 ][wait3] -> [ Winner302 ][wait0] again
late [ Winner211 ] -> Win
late [ Winner210 ][wait3] -> [ Winner211 ][wait0] again
late [ Winner209 ][wait3] -> [ Winner210 ][wait0] again
late [ Winner208 ][wait3] -> [ Winner209 ][wait0] again
late [ Winner207 ][wait3] -> [ Winner208 ][wait0] again
late [ Winner206 ][wait3] -> [ Winner207 ][wait0] again
late [ Winner205 ][wait3] -> [ Winner206 ][wait0] again
late [ Winner204 ][wait3] -> [ Winner205 ][wait0] again
late [ Winner203 ][wait3] -> [ Winner204 ][wait0] again
late [ Winner202 ][wait3] -> [ Winner203 ][wait0] again
late [ Winner201 ][wait3] -> [ Winner202 ][wait0] again
late [ Winner109 ] -> Win
late [ Winner108 ][wait3] -> [ Winner109 ][wait0] again
late [ Winner107 ][wait3] -> [ Winner108 ][wait0] again
late [ Winner106 ][wait3] -> [ Winner107 ][wait0] again
late [ Winner105 ][wait3] -> [ Winner106 ][wait0] again
late [ Winner104 ][wait3] -> [ Winner105 ][wait0] again
late [ Winner103 ][wait3] -> [ Winner104 ][wait0] again
late [ Winner102 ][wait3] -> [ Winner103 ][wait0] again
late [ Winner101 ][wait3] -> [ Winner102 ][wait0] again
late [ Winner008 ] -> Win
late [ Winner007 ][wait3] -> [ Winner008 ][wait0] again
late [ Winner006 ][wait3] -> [ Winner007 ][wait0] again
late [ Winner005 ][wait3] -> [ Winner006 ][wait0] again
late [ Winner004 ][wait3] -> [ Winner005 ][wait0] again
late [ Winner003 ][wait3] -> [ Winner004 ][wait0] again
late [ Winner002 ][wait3] -> [ Winner003 ][wait0] again
late [ Winner001 ][wait3] -> [ Winner002 ][wait0] again
(Apples and Mumblings)
late [ Player Apple ] -> [ Player AppleCore] sfx9
late [ Player m1 ] -> [ Player ] message Doesn't make much sense to put easter eggs into an open source game, does it? :)
late [ Player m2 ] -> [ Player ] message Ooooo! An apple!
late [ Player m3 ] -> [ Player ] message Who even builds warehouses like this!?
late [ Player m4 ] -> [ Player ] message Boy, has science funding in this country seen better days...
late [ Player m5 ] -> [ Player ] message You've gained +3 health!
late [ Player m6 ] -> [ Player ] message Wait... how was I supposed to find this one!?
(The cutscene ;)
late [ Crate lastTarget ] -> [ yeaCrate lastTarget ]
late [lastTarget][ Crate ][ yeaCrate ] -> [lastTarget][ Crate ][ Crate ]
late down [yeaCrate][cloud | ... | Player] -> [lastCrateOnTarget][cloud fapple0 | ... | Player] sfx10 (the aimed apple spawn)
down [ fapple | Player ] -> [ fapple | Finalist0 wait0 ] sfx8 again
(The intriguing pause)
[Finalist2 wait5] -> [Genius] again
[Finalist1 wait5] -> [Finalist2 wait0] again
[Finalist0 wait5] -> [Finalist1 wait0] again
random [cloud no fapple][Genius] -> [cloud random fapple][Genius]
down [ cloud fapple | ... | spaace no fapples | fapples] -> [ cloud fappleg | ... | spaace | fapples]
down [ fapples | no wall no players no fapples no lastCrateOnTarget] -> [> fapples |] again
down [fapples | ... | moving fapples] -> [ | ... | moving fapples]
(These are only for sfx)
[> fapples | | wall] -> [ | fapples | wall] sfx4
[> fapples | | lastCrateOnTarget] -> [ | fapples | lastCrateOnTarget] sfx4
[> fappleg | | fapples] -> [ | fappleg | fapples] sfx1
[> fapple0 | | fapples] -> [ | fapple0 | fapples] sfx2
[> fapple1 | | fapples] -> [ | fapple1 | fapples] sfx3
[> fapple2 | | fapples] -> [ | fapple2 | fapples] sfx5
[> fapple3 | | fapples] -> [ | fapple3 | fapples] sfx6
(Randomize clouds for the next iteration)
[Clearsky] -> [cloud]
[moving fapple][cloud] -> [moving fapple][random Clearsky]
[clearsky1] -> [cloud]
[cloud] -> [cloud] again
(Squashing)
left [stationary fapples | stationary squashing] -> [fapples squashL | squashing]
right [stationary fapples | stationary squashing] -> [fapples squashR | squashing]
down [stationary fapples | stationary squashing] -> [fapples squashD | squashing]
up [stationary fapples | stationary squashing] -> [fapples squashU | squashing]
[squashU squashL] -> [squashU squashL squashUL]
[squashU squashR] -> [squashU squashR squashUR]
[squashD squashL] -> [squashD squashL squashDL]
[squashD squashR] -> [squashD squashR squashDR]
[squashD squashU squashL squashR] -> []
right [stationary fappleg | stationary fappleg] -> [fappleg squashgR | squashgL fappleg]
down [stationary fappleg | stationary fappleg] -> [fappleg squashgD | squashgU fappleg]
==============
WINCONDITIONS
==============
(All zCrate on Target)
=======
LEVELS
=======
#####################
#####################
#####################
#####################
#######o#############
#######.......#######
#######.####1.#######