forked from Frakasss/ZombiEscape
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ZombiEscape.ino
939 lines (866 loc) · 80.7 KB
/
ZombiEscape.ino
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
#include <SPI.h>
#include <Gamebuino.h>
Gamebuino gb;
const byte ZombiSpeed[] PROGMEM = {8, 10, B00011100, B00011100, B00011100, B00001000, B00111100, B00011100, B00001100, B00011100, B00010110, B00110010,};
const byte Zombi[] PROGMEM = {8, 13, B00011100, B00111110, B00111110, B00001110, B00011100, B00001110, B01111110, B00011110, B00001110, B00001110, B00001010, B00001010, B00011110,};
const byte ZombiBig[] PROGMEM = {8, 18, B01111100, B11111110, B11111110, B10110110, B11111110, B11111110, B10101011, B01010111, B01111111, B00111111, B11111111, B11111111, B01111111, B00111111, B00111111, B00110011, B01110111, B01110111,};
const byte ZombiDead[] PROGMEM = {8, 4, B01110001, B11111010, B10101111, B11111111};
const byte Me[] PROGMEM = {8, 10, B00111000, B01111110, B01111100, B01111100, B00111000, B00010000, B00111000, B00111000, B00111000, B00111000,};
const byte MeLegs1[] PROGMEM = {8, 3, B10100000, B10100000, B11110000,};
const byte MeLegs2[] PROGMEM = {8, 3, B01000000, B01000000, B01100000,};
const byte MeWeapon[] PROGMEM = {8, 3, B00111110, B11111000, B01100000,};
const byte MeWeaponReload[] PROGMEM = {8, 6, B10000000, B10000000, B11000000, B11000000, B11100000, B01100000,};
const byte WorldStart[] PROGMEM = {16, 44, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xC, 0x88, 0x11, 0x48, 0x15, 0x40, 0xD, 0x88, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xFF, 0xFF,};
const byte Sprite01[] PROGMEM = {32, 19, B01001000, B00000000, B00000000, B00010010, B01001000, B00000000, B00000000, B00010010, B01010000, B00000000, B00000000, B00001010, B01010000, B00000000, B00000000, B00001010, B01111000, B00000000, B00000000, B00011110, B01001001, B11111100, B00111111, B10010010, B01001001, B00000100, B00100000, B10010010, B01110001, B00000100, B00100000, B10001110, B01010001, B00000100, B00100000, B10001010, B01010001, B00000100, B00100000, B10001010, B01111001, B00000100, B00100000, B10011110, B01001011, B11111110, B00100000, B10010010, B01001010, B00000010, B00100010, B10010010, B01110001, B11111100, B00100010, B10001110, B01010000, B00000000, B00100000, B10001010, B01010000, B00000000, B00100000, B10001010, B01111000, B00000000, B00100000, B10011110, B01001000, B00000000, B00100000, B10010010, B11111111, B11111111, B11111111, B11111111,};
const byte Sprite02[] PROGMEM = {32, 19, B01110010, B00000000, B00000000, B01001110, B01010001, B11111111, B11111111, B10001010, B01010000, B00000000, B00000000, B00001010, B01111011, B11111111, B11011111, B11011110, B01001010, B00000000, B01010000, B01010010, B01001010, B00000100, B01010000, B01010010, B01110010, B00001000, B01010000, B01001110, B01010010, B00010000, B01010000, B01001010, B01010010, B00000100, B01010000, B01001010, B01111010, B00001000, B01010000, B01011110, B01001010, B00010000, B01010000, B01010010, B01001010, B00000000, B01011000, B01010010, B01110010, B00000000, B01010000, B01001110, B01010011, B11111111, B11010000, B01001010, B01010000, B00000000, B00010000, B01001010, B01111000, B00000000, B00010000, B01011110, B01001000, B00000000, B00010000, B01010010, B01001000, B00000000, B00010000, B01010010, B11111111, B11111111, B11111111, B11111111,};
const byte Sprite03[] PROGMEM = {24, 21, B01000000, B00000000, B00000010, B01001111, B11100111, B11110010, B01001000, B00100100, B00010010, B01001000, B00100100, B00010010, B01001000, B00100100, B00010010, B01001000, B00100100, B00010010, B01001000, B00100100, B00010010, B01001111, B11100111, B11110010, B01000000, B00000000, B00000010, B01000000, B00000000, B00000010, B01000000, B00000000, B00000010, B01000000, B00000000, B00000010, B01000011, B11111000, B00000010, B01000100, B01000100, B00000010, B01000100, B01000010, B00000010, B01001111, B11111111, B10000010, B01010000, B00000000, B01000010, B01010110, B00000110, B11000010, B11111001, B00001001, B01111111, B00011001, B11111001, B11000000, B00000110, B00000110, B00000000,};
const byte Sprite04[] PROGMEM = {32, 19, B01000000, B00000110, B10101010, B10000010, B01000000, B00001110, B10111111, B11000010, B01000000, B00011010, B10100000, B01000010, B01000000, B00111010, B11011111, B10000010, B01000000, B01101010, B10100000, B00000010, B01000000, B11101011, B01000000, B00000010, B01000001, B10101010, B10011111, B11000010, B01000011, B10101101, B00010000, B01000010, B01000110, B10101010, B00010001, B01000010, B01001110, B10110100, B00010010, B01000010, B01011010, B10101000, B00010100, B01000010, B01011010, B11010000, B00010001, B01000010, B01001010, B10100000, B00010010, B01000010, B01001011, B01000000, B00010100, B01000010, B01001010, B10000000, B00010000, B01000010, B01001101, B00000000, B00011111, B11000010, B01001010, B00000000, B00000000, B00000010, B01010100, B00000000, B00000000, B00000010, B11111111, B11111111, B11111111, B11111111,};
const byte Sprite05[] PROGMEM = {24, 21, B01011111, B11111111, B11111010, B01010000, B00011000, B00001010, B01001111, B11100111, B11110010, B01000000, B00000000, B00000010, B01001111, B11100111, B11110010, B01001000, B00100100, B00010010, B01001000, B00100100, B00010010, B01001000, B00100100, B00010010, B01001000, B00100100, B00010010, B01011111, B11111111, B11111010, B01010000, B00011000, B00001010, B01001111, B11100111, B11110010, B01000000, B00000000, B00000010, B01000000, B00001100, B00000010, B01000000, B00000111, B00000010, B01000000, B00011111, B00000010, B01000011, B11111110, B00000010, B01000011, B11111111, B10000010, B11111001, B00111011, B01011111, B00000011, B11111010, B01000000, B00000000, B11000001, B10000000,};
const byte Sprite06[] PROGMEM = {32, 19, B00111000, B00000000, B00000000, B00011100, B01111100, B00000000, B00000000, B00111110, B01000100, B00000000, B00000000, B00100010, B01000100, B00000000, B00000000, B00100010, B00111000, B00000000, B00000000, B00011100, B00010000, B00000000, B00000000, B00001000, B00010000, B00000000, B00000000, B00001000, B00010000, B01111111, B00000000, B00001000, B00010000, B10000000, B10000000, B00001000, B00010001, B00000111, B01000000, B00001000, B00010001, B00001000, B11000000, B00001000, B00010001, B11111111, B11000000, B00001000, B00010010, B00000000, B00100000, B00001000, B00010010, B11010101, B10100000, B00001000, B00111010, B11101011, B10100000, B00011100, B00111010, B00000000, B00100000, B00011100, B00111001, B11111111, B11000000, B00011100, B00111001, B10000000, B11000000, B00011100, B11111111, B11111111, B11111111, B11111111,};
const byte Sprite07[] PROGMEM = {8, 1, B11111111,};
const byte Sprite08[] PROGMEM = {32, 19, B00000000, B10000100, B00010000, B10000000, B00000001, B00000010, B00100000, B01000000, B00000001, B00000010, B00100000, B01000000, B00000001, B00111001, B01001110, B01000000, B00000001, B01000101, B01010001, B01000000, B00000001, B01000101, B01010001, B01000000, B00000010, B10000011, B01100000, B10100000, B00000010, B10000011, B01100000, B10100000, B00000010, B00000001, B11000000, B00100000, B00000010, B00000001, B11000000, B00100000, B00000010, B00000000, B10000000, B00100000, B00000010, B00000011, B11100000, B00100000, B00000000, B00000100, B00010000, B00000000, B00000000, B00000100, B00010000, B00000000, B00111111, B11111111, B11111111, B11111100, B00100000, B00000000, B00000000, B00000100, B00011100, B00000000, B00000000, B00111000, B00001000, B00000000, B00000000, B00010000, B11111111, B11111111, B11111111, B11111111,};
const byte Sprite09[] PROGMEM = {16, 19, B00000011, B11000000, B00000100, B00100000, B00000100, B00010000, B00001000, B00001000, B00001000, B00001000, B00001000, B00000100, B00010000, B00000100, B00010000, B00000100, B00010000, B00001000, B00010000, B00001000, B00010000, B00010000, B00001000, B00010000, B00000100, B00010000, B00000011, B11100000, B00000001, B01000000, B00000001, B01000000, B00000001, B01000000, B00000001, B01000000, B11111111, B11111111,};
const byte Sprite11[] PROGMEM = {48, 19, B00000100, B00001000, B10000100, B10100001, B00100001, B00000000, B00000100, B00001001, B00001000, B10010000, B11111111, B10000000, B00000111, B11111010, B00010000, B10001000, B01000000, B10000000, B00000100, B00001100, B00100000, B10000100, B00100000, B10000000, B00000100, B00011000, B01000000, B10000010, B00010000, B10000000, B00000011, B11110000, B10000000, B10000001, B00001111, B10000000, B00000000, B00100001, B00000000, B10000000, B10000100, B10000000, B00000000, B01000011, B00000001, B11100000, B11000010, B10000000, B00000000, B10000101, B11000010, B00010011, B10100001, B00000000, B00000001, B00001000, B11111111, B11111111, B00010000, B10000000, B00000010, B00010000, B00111100, B00001100, B00001000, B01000000, B00000100, B00100000, B00000100, B00001000, B00000100, B00100000, B00001000, B01000000, B00000100, B00001000, B00000010, B00010000, B00010000, B10000000, B00000111, B11111000, B00000001, B00001000, B01111111, B11000000, B00000100, B00001000, B00000011, B11111110, B01000000, B01000000, B00000100, B00001000, B00000010, B00000010, B01000000, B01000000, B00000011, B11110000, B00000010, B00000010, B01000000, B01000000, B00000000, B00000000, B00000010, B00000010, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111,};
const byte Sprite12[] PROGMEM = {16, 19, B00000000, B01110001, B00000001, B10001111, B00000111, B01000001, B00011010, B11000010, B01110101, B01100100, B10101010, B10111000, B01111111, B11110000, B00001000, B01000000, B01111111, B11111100, B10000000, B00000010, B10111111, B11111010, B10100000, B00001010, B10100000, B00001010, B10100000, B00001010, B10100000, B00001010, B10111111, B11111010, B10000000, B00000010, B10000000, B00000010, B11111111, B11111111,};
const byte Sprite13[] PROGMEM = {16, 19, B01111000, B00000000, B00111111, B11000000, B01101010, B10111000, B01010101, B01010111, B01101010, B10111000, B00111111, B11000000, B01111000, B01000000, B00001000, B01000000, B01111111, B11111100, B10000000, B00000010, B10111111, B11111010, B10100000, B00001010, B10100000, B00001010, B10100000, B00001010, B10100000, B00001010, B10111111, B11111010, B10000000, B00000010, B10000000, B00000010, B11111111, B11111111,};
const byte Sprite14[] PROGMEM = {16, 19, B00011111, B11110000, B00101010, B10101000, B01000000, B00000100, B01111111, B11111100, B00111111, B11111000, B01111111, B11111100, B01000000, B00000100, B00111111, B11111000, B00001000, B00100000, B11111111, B11111110, B10000000, B00000010, B10111111, B11111010, B10100000, B00001010, B10100000, B00001010, B10100000, B00001010, B10111111, B11111010, B10000000, B00000010, B10000000, B00000010, B11111111, B11111111,};
const byte Sprite15[] PROGMEM = {56, 19, B00001010, B10001110, B00000000, B00011110, B10001010, B00100011, B11111100, B00001001, B00000111, B00000000, B01111001, B00000100, B00011111, B11101000, B00001010, B10001011, B11100011, B11110010, B10001010, B01111111, B00001000, B00001100, B01010001, B11111111, B11110100, B01010011, B11111100, B00011000, B00001000, B00100000, B10111110, B00001000, B00101111, B11001010, B00101000, B00001100, B01010001, B01000101, B00010100, B00111111, B01001001, B01001000, B00001010, B10001010, B00101000, B10100011, B11111000, B10001000, B10001000, B00001001, B00000100, B00010000, B01000111, B11001001, B01001001, B01001000, B00111110, B10001010, B00101000, B10111111, B10101010, B00101010, B00101000, B01000001, B01010001, B01000101, B11111100, B00011100, B00011100, B00011000, B01011101, B00100000, B10000011, B11111111, B11111111, B11111111, B11111000, B01010101, B01010001, B01011111, B10011100, B00011100, B00011100, B00011000, B01010101, B10001010, B01111110, B00101010, B00101010, B00101010, B00101000, B01010101, B00000111, B11111001, B01001001, B01001001, B01001001, B01001000, B01010101, B10001111, B10001000, B10001000, B10001000, B10001000, B10001000, B01011101, B01111111, B01001001, B01001001, B01001001, B01001001, B01001000, B01000001, B11111010, B00101010, B00101010, B00101010, B00101010, B00101000, B01000001, B11001100, B00011100, B00011100, B00011100, B00011100, B00011000, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111,};
const byte Sprite16[] PROGMEM = {40, 19, B00010101, B01010100, B00000000, B00101010, B10101000, B00111111, B11111101, B11000000, B00111111, B11111100, B01111111, B11111100, B00000001, B10111111, B11111110, B11111111, B11111100, B00100100, B00111111, B11111111, B11111111, B11111100, B01111110, B00111111, B11111111, B01000000, B00000100, B11111111, B00100000, B00000010, B01000011, B10011101, B11111111, B10100000, B00111010, B01100100, B01000100, B00000000, B00110000, B00000010, B01001010, B10100100, B01111110, B00100111, B11100010, B01001001, B00100100, B10000001, B00001000, B00010010, B01001110, B11100101, B00000000, B10000000, B00001010, B01001001, B00100101, B01100110, B10001100, B00001010, B01001001, B00100100, B01100110, B00001100, B10001010, B01001001, B00101100, B11111111, B00111100, B01100010, B01001001, B00100101, B00000000, B10101100, B01010010, B01001111, B11100101, B01100110, B10101111, B11001010, B01110000, B00000101, B00000000, B10100000, B00001010, B01000000, B00011111, B11111111, B11111111, B11111110, B11111111, B11111111, B11111111, B11111111, B11111111,};
const byte Sprite17[] PROGMEM = {24, 19, B00000000, B11111111, B00000000, B00011111, B00000000, B11111000, B00100000, B01001110, B00000100, B00101110, B10101010, B11100100, B00101010, B11101100, B10000100, B00101100, B10101010, B10000100, B00101000, B00000000, B01100100, B00100000, B11111111, B00000100, B00111111, B00000000, B11111100, B00110000, B00000000, B00001100, B00110000, B00000000, B00001100, B01111000, B00000000, B00011110, B11111100, B00000000, B00111111, B01001000, B00000000, B00010010, B01001000, B00000000, B00010010, B01001000, B00000000, B00010010, B01001000, B00000000, B00010010, B01001000, B00000000, B00010010, B11111111, B11111111, B11111111,};
const byte Sprite18[] PROGMEM = {24, 19, B11010101, B01010101, B01010101, B10101010, B10101010, B10101011, B11010101, B01010101, B01010101, B10101010, B10101010, B10101011, B11010101, B01010101, B01010101, B10101010, B10101010, B10101011, B11010101, B01010101, B01010101, B10101010, B10101010, B10101011, B11010101, B00110101, B01010101, B01101011, B00011000, B10101010, B00110101, B10000011, B01010110, B00011010, B11000110, B10101100, B00001101, B01001101, B01111000, B00000110, B11001111, B11000000, B00000011, B11001000, B00000000, B00000000, B01001000, B00000000, B00000000, B01001000, B00000000, B00000000, B01001000, B00000000, B11111111, B11111111, B11111111,};
const byte Sprite19[] PROGMEM = {24, 19, B11010101, B01010101, B01010101, B10101010, B10101010, B10101011, B11010101, B01010101, B01010110, B10101010, B10101010, B10101010, B11010101, B01010101, B01010110, B11101010, B10101010, B10101010, B01010101, B01010011, B01010110, B01101010, B10110010, B10101010, B01010101, B01010011, B01010110, B01101010, B10110010, B10101100, B00110101, B01110111, B01011000, B00001111, B10100110, B10110000, B00000000, B00100101, B11100000, B00000000, B00100100, B00000000, B00000000, B00100100, B00000000, B00000000, B00100010, B00000000, B00000000, B01100010, B00000000, B00000000, B01000001, B00000000, B11111111, B11111111, B11111111,};
const byte Sprite20[] PROGMEM = {16, 10, B00111111, B11000000, B00100000, B00100000, B00111111, B11100000, B00010000, B01000000, B00111111, B11111000, B00100001, B00000100, B00111111, B11111100, B00010010, B01001000, B00010010, B01001000, B11111111, B11111111,};
const byte Sprite21[] PROGMEM = {8, 19, B00111000, B01111100, B01000100, B01000100, B01000100, B00111000, B00010000, B00010000, B00010000, B00010000, B00010000, B00010000, B00010000, B00010000, B00111000, B00111000, B00111000, B00111000, B11111111,};
const byte Sprite22[] PROGMEM = {16, 10, B00000011, B11111100, B00000100, B00000100, B00000111, B11111100, B00000010, B00001000, B00011111, B11111100, B00100000, B00000100, B00111111, B11111100, B00010010, B01001000, B00010010, B01001000, B11111111, B11111111,};
const byte Sprite23[] PROGMEM = {24, 19, B00001100, B00000000, B00000000, B00010010, B00000000, B00000000, B00111111, B00000000, B00000000, B01000000, B10000000, B00000000, B11111111, B11000000, B00000000, B01000000, B10000000, B00000000, B01001110, B10000000, B00000000, B01001110, B10000000, B11111110, B01001110, B11000001, B10101010, B01001110, B10111110, B10101010, B01111111, B10101010, B11111110, B01001010, B11101011, B11111110, B01001110, B10111110, B10000010, B01001010, B10000000, B10000010, B01001110, B10000000, B10000010, B01001010, B10000000, B10000010, B01001110, B10000000, B10000010, B01001010, B10000000, B10000010, B11111111, B11111111, B11111111,};
const byte Sprite24[] PROGMEM = {16, 9, B00000000, B00000100, B00000000, B00001110, B00000001, B10110000, B00000001, B11000000, B00000011, B10000000, B00101101, B10000000, B01110001, B10000000, B00000011, B11000000, B11111111, B11111111,};
const byte Sprite25[] PROGMEM = {24, 13, B00000000, B10000000, B00000000, B00000001, B01000000, B00000000, B00000001, B01000000, B00000000, B00000001, B11110000, B00000000, B00000011, B11111000, B00000000, B00000010, B10011100, B00000000, B00000111, B00001110, B00000000, B00000101, B00000111, B00000000, B00001110, B00000011, B10000000, B00001010, B00000001, B11000000, B00011100, B00000000, B11111100, B00010100, B00000000, B01111000, B11111111, B11111111, B11111111,};
const byte WorldEnd[] PROGMEM = {16, 44, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3A, 0xB8, 0x13, 0xB0, 0x12, 0xB8, 0x0, 0x0, 0x39, 0x98, 0x31, 0x54, 0x39, 0x58, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xFF, 0xFF,};
const int SprintSize[26][2] = {{0, 0}, {32, 19}, {32, 19}, {24, 19}, {32, 19}, {24, 19}, {32, 19}, {8, 1}, {32, 19}, {16, 19}, {0, 0}, {48, 19}, {16, 19}, {16, 19}, {16, 19}, {56, 19}, {40, 19}, {24, 19}, {24, 19}, {24, 19}, {16, 10}, {8, 19}, {16, 10}, {24, 19}, {16, 9}, {24, 13}};
//const byte Welcome[] PROGMEM = {64,29,B00000000,B00000000,B00000000,B00000000,B00000000,B00001111,B10000000,B00111000,B00001111,B11110000,B00000000,B00000000,B00000000,B00010000,B01000000,B01000100,B00010000,B00001000,B00000000,B00000000,B00000000,B00010000,B01000000,B01000100,B00100000,B00000100,B00000000,B00000000,B00000000,B00001000,B01000000,B01000100,B00100000,B00000100,B00000000,B00000000,B00000000,B00001000,B01000000,B00111000,B00100011,B10000100,B00000000,B00000000,B00000000,B00001000,B01000000,B00000000,B00111100,B10000100,B00000000,B00000000,B00000000,B00001000,B01000000,B00000000,B00000001,B00001000,B00001111,B00000011,B11000111,B10001000,B01000000,B01110000,B00000010,B00110000,B00010000,B10000100,B00111000,B01001000,B01110000,B10001000,B00000100,B01000000,B00100000,B01001000,B00000000,B00101000,B00011000,B10001000,B00001000,B10000110,B01000000,B00101000,B00000000,B00101001,B11001100,B10001000,B00010001,B00001001,B01001110,B00101000,B11000110,B00101010,B00100101,B00001000,B00100001,B11110001,B01010001,B00101000,B10111010,B00101010,B00100101,B00010000,B00100000,B00000001,B01010001,B00101000,B10000010,B00101010,B00100101,B00010000,B00100000,B00000001,B01001110,B01001000,B10000010,B00101001,B11000101,B00010000,B00010000,B00000001,B00100000,B10001000,B10000010,B00101000,B00001001,B00010000,B00001111,B11111111,B00011111,B00000111,B10000011,B11000111,B11110000,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111,B00111110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11110000,B01111110,B11111001,B11111000,B01111100,B01111100,B00000000,B00000000,B11111000,B01110000,B11111011,B11111000,B11111100,B11111110,B00000000,B00000000,B11111000,B01111101,B11000011,B10011000,B11001110,B11001110,B00000000,B00000000,B11000000,B00111101,B11000011,B00011000,B11001110,B11111110,B00000000,B00000000,B11100000,B00001101,B11000011,B10111100,B11111110,B11100000,B00000000,B00000000,B11111110,B11111100,B11111011,B11111110,B11111110,B11111111,B00000000,B00000000,B01111110,B11111000,B11111001,B11110110,B11111000,B01111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11000000,B00000000,B00000000,};
//const byte Welcome[] PROGMEM = {64,29,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B10000000,B00110000,B00000000,B00000000,B00000000,B00000000,B00001000,B00000000,B10001000,B01000000,B00000000,B00000000,B00000000,B00000000,B00010001,B10110100,B11100000,B01100010,B01010001,B10110000,B00000000,B00000000,B00100010,B10101010,B10101000,B01000100,B10001010,B10100000,B00000000,B00000000,B00111011,B00101010,B11001000,B00110010,B01011011,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00000010,B00000000,B00000000,B00000001,B11111111,B11111111,B11111111,B11111111,B11111010,B11111110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101010,B00000000,B00000000,B00000000,B00000000,B00011111,B10000000,B00000000,B01111100,B01100000,B00000000,B00000000,B00000000,B00100000,B01000000,B00001100,B10001010,B00111110,B00000000,B00000000,B00000000,B00100000,B00100000,B00010001,B10010001,B00111111,B00000000,B00000000,B00000001,B11111111,B11100000,B11000010,B10000001,B01110000,B10000000,B00000000,B00000000,B00100000,B11100000,B00100111,B00110001,B01100010,B00010000,B00000000,B00000000,B00110100,B11100000,B10010010,B00110011,B01000001,B11100000,B00000000,B00000000,B00100000,B00100000,B01110010,B10000001,B00101011,B11110000,B00000000,B00000000,B00011100,B01000000,B01110010,B10001101,B00100111,B10101000,B00000000,B00000000,B00010000,B01000000,B00010001,B00011110,B01000111,B00011000,B00000000,B10000000,B10001111,B10000000,B11010000,B11111100,B01000101,B01001000,B00000000,B11111111,B00000101,B11100000,B10100100,B01001000,B00000100,B00001000,B00000000,B00001111,B11111110,B01110000,B01000000,B10011111,B10100010,B01110000,B00000000,B00000111,B00001000,B10111000,B10000001,B01000010,B01010001,B11100000,B00000000,B00000001,B11111111,B00111000,B11110001,B00111101,B01010010,B01000000,B00000000,B00000001,B10000101,B00111000,B00001001,B00010001,B10100100,B11100100,B00000000,B00000000,B00000101,B10111000,B11101010,B01010000,B00000110,B00111000,B00000000,B00000000,B00000100,B11111000,B10010010,B10010010,B01000101,B11100100,B00000000,B00000000,B00000010,B00010000,B00000010,B00010010,B00000100,B01000000,B00000000,B00000000,B00000010,B00010000,};
const byte Welcome[] PROGMEM = {72, 35, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000001, B11000000, B00000100, B00000001, B10000000, B00000000, B00000000, B00000000, B00000000, B00000000, B01000000, B00000100, B01000010, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B10001101, B10100111, B00000011, B00010010, B10001101, B10000000, B00000000, B00000000, B00000001, B00010101, B01010101, B01000010, B00100100, B01010101, B00000000, B00000000, B00000000, B00000001, B11011001, B01010110, B01000001, B10010010, B11011000, B10000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00100000, B00010000, B00000000, B00000000, B00000000, B00001111, B11111111, B11111111, B11111111, B11111111, B11010111, B11110000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B01111110, B00000000, B00000000, B00000001, B01010000, B00000000, B00000000, B00000000, B00000000, B10000001, B00000000, B00000000, B00000011, B11100011, B00000000, B00000000, B00000000, B00000000, B10000000, B10000000, B00000000, B00000100, B01010001, B11110000, B00000000, B00000000, B00000111, B11111111, B10000000, B00000000, B00001100, B10001001, B11111000, B00000000, B00000000, B00000000, B10000011, B10000000, B00001111, B00010100, B00001011, B10000100, B00000000, B00000000, B00000000, B11010011, B10000000, B00011000, B10011001, B10001011, B00000000, B00000000, B00000000, B00000000, B10000001, B10000000, B00101010, B01010001, B10011010, B00101111, B10000000, B00000000, B00000000, B10111000, B10000000, B00110001, B11010100, B00001001, B00011111, B10000000, B00000000, B00000000, B10011001, B00000000, B00101101, B11010100, B01101001, B00111101, B01000000, B00000000, B00000000, B01000001, B00000000, B00100000, B01001000, B11110000, B10111000, B11000000, B00000010, B00000010, B00111110, B00000000, B00010111, B01000111, B11100001, B10101010, B01000000, B00000011, B11111100, B00010111, B10000000, B00010110, B10000011, B11000001, B11100001, B11000000, B00000000, B00111111, B11111001, B11000000, B00010001, B00000111, B11111001, B11110011, B10000000, B00000000, B00011100, B00100010, B11100000, B00011010, B00001111, B11100101, B11101111, B00000000, B00000000, B00000111, B11111100, B11100000, B00111111, B11001011, B11010101, B11011110, B00000000, B00000000, B00000110, B00010100, B11100000, B00111111, B00101100, B10011001, B11011010, B01000000, B00000000, B00000000, B00010110, B11100000, B00111111, B10111111, B10000011, B11111101, B10000000, B00000000, B00000000, B00010011, B11100000, B00111110, B01011111, B10000011, B11111110, B01000000, B00000000, B00000000, B00001000, B01000000, B01111110, B00011111, B10000011, B10111110, B00000000, B00000000, B00000000, B00001000, B01000000,};
const byte Congratulation[] PROGMEM = {88, 48, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111100, B00111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111000, B00011111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11110000, B00100111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11110000, B01000011, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11110111, B00011111, B11111111, B00111111, B11111111, B11111111, B11111111, B11111111, B11000000, B11111110, B11111111, B11110000, B00011111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B10000001, B11111100, B11101111, B11110000, B00011111, B11111111, B11001111, B11111111, B11111111, B11111111, B11111111, B10000011, B11001101, B11111111, B11111000, B00111111, B11111111, B11111111, B11111101, B11111111, B11111111, B11111111, B10000101, B11111111, B10001111, B11111000, B01111111, B11111111, B11111111, B11001011, B11111111, B11111111, B11111111, B10000111, B11101111, B11111111, B11111100, B11111111, B11111111, B00000000, B00001111, B00111111, B11111111, B11111111, B00100010, B11111101, B11111111, B11110100, B00001100, B00000000, B01110000, B00001101, B11110011, B11111111, B11111111, B10000000, B11111011, B11111111, B11100011, B10000000, B00000011, B00000011, B11111110, B11111100, B01111111, B11111111, B10000001, B11111110, B11111111, B11000011, B11000000, B00000101, B01011111, B11111111, B11100000, B00000000, B00000000, B00000010, B11111111, B10111111, B11000111, B10100011, B11111110, B00111111, B11111111, B11100000, B00000000, B00000000, B00000001, B11111111, B11111111, B11000011, B10000111, B11111100, B01111111, B11111111, B11101000, B00000000, B00000000, B00000000, B11111111, B11111111, B11000011, B10001111, B11111100, B01111111, B11111111, B11111000, B00000000, B00000000, B00000000, B11111111, B11111111, B11000011, B11001111, B11111111, B11111111, B11111111, B11111110, B00111111, B00000000, B00000000, B11111111, B11111111, B11000011, B11001111, B11111111, B11111111, B11111111, B11111111, B11000000, B00110000, B00000000, B11111111, B11111111, B11000011, B11001111, B11111111, B11111111, B11111111, B11111111, B10111100, B00000000, B00000000, B11111111, B11111111, B10000011, B11001111, B11111111, B11111111, B11111111, B11111100, B00000000, B00000000, B00000000, B11111111, B11111111, B10000011, B11000111, B11111111, B11111111, B11111111, B11111000, B00000000, B00000000, B00000001, B11111111, B11111111, B10000011, B11000111, B11111111, B11111111, B11111111, B11111010, B00000000, B00000000, B00000001, B11111111, B11111111, B10010011, B11000111, B11111111, B11111111, B11111111, B11111110, B00010001, B10000000, B00000000, B11111111, B11111111, B10000011, B11000111, B11111111, B11111111, B11111111, B11111111, B11000111, B00100000, B00000001, B11111111, B11111111, B11011011, B11000111, B11111111, B11111111, B11111111, B11111111, B11111111, B11110000, B00000000, B11111111, B11111111, B10000111, B11100111, B11111111, B11111111, B11111111, B11111111, B11111111, B11100000, B00000000, B11111111, B11111111, B11000000, B00011111, B11111111, B11111111, B11111111, B11101111, B11111111, B11000000, B00000111, B11111111, B11111111, B11111000, B00011111, B11111111, B11111111, B11111111, B11111111, B11111111, B00000000, B00000111, B11111111, B11111111, B11100000, B00011111, B11111111, B11111111, B11111111, B11111111, B11111111, B00000000, B00000111, B11111111, B11111111, B11100000, B00011111, B11111111, B11111111, B11111111, B11111111, B11111111, B00000000, B00000111, B11111111, B11111111, B11110100, B00011111, B11111111, B11111111, B11111111, B11111111, B11111111, B00000000, B00000111, B11111111, B11111111, B11100000, B00011111, B11111111, B11111111, B11111111, B11111111, B11111111, B00000000, B00000011, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B10000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00011111, B10000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00011111, B10000111, B00110011, B00100111, B01110011, B10011111, B01101101, B10001110, B01111101, B11001100, B11001001, B00011111, B10001000, B01001001, B10101000, B00101001, B01010101, B00100100, B10000101, B01010100, B10010010, B01101001, B00011111, B10001000, B01001001, B01101000, B00101001, B01000100, B00100100, B10000101, B00010000, B10010010, B01011001, B00011111, B10001000, B01001001, B01101001, B00110001, B11000100, B00100100, B10100111, B00010000, B10010010, B01011000, B00011111, B10000111, B00110011, B00100111, B01101011, B01001110, B00011001, B11101101, B00111001, B11001100, B11001001, B00011111, B10000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00011111, B10000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00011111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111,};
const byte GameOver[] PROGMEM = {88, 48, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11000111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B10000011, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B10011011, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11001101, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11100011, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11010111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111011, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111011, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111011, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11110111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111101, B01111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111101, B01111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B10101001, B00101111, B11111111, B11111110, B00000000, B00000000, B00000000, B00111111, B11111111, B11111111, B11111111, B11110011, B11000111, B11111111, B11111110, B01110111, B00110001, B01111000, B00111111, B11111111, B11111111, B11111110, B11111101, B10000111, B11111111, B11111110, B10000010, B10011011, B00100000, B00111111, B11111111, B11111111, B11111101, B01101111, B10010111, B11111111, B11111110, B10000010, B10010101, B00110000, B00111111, B11111111, B11111111, B11111101, B00100111, B00010011, B11111111, B11111110, B10010011, B10010001, B00100000, B00111111, B11111111, B11111111, B11111001, B00100001, B00011011, B11111111, B11111110, B01110110, B10110001, B01111000, B00111111, B11111111, B11111111, B11111011, B00110001, B00010011, B11111111, B11111110, B00000000, B00000000, B00000000, B00111111, B11111111, B11111111, B11111001, B00111001, B00010011, B11111111, B11111110, B00000000, B00000000, B00000000, B00111111, B11111111, B11111111, B11111001, B10100101, B00110101, B11111111, B11111110, B00000000, B00000000, B00000000, B00111111, B11111111, B11111111, B11110001, B10100001, B00111001, B11111111, B11111110, B00000000, B00000000, B00000000, B00111111, B11111111, B11111111, B11100011, B10100011, B01111010, B11111111, B11111110, B00000011, B00100010, B11110111, B00111111, B11111111, B11111111, B11110011, B00100001, B00011001, B11111111, B11111110, B00000100, B10100010, B01000010, B10111111, B11111111, B11111111, B11101111, B01000001, B10011110, B11111111, B11111110, B00000100, B10010100, B01100010, B10111111, B11111111, B11111111, B10101110, B01001000, B10001110, B01111111, B11111110, B00000100, B10010100, B01000011, B00111111, B11111111, B11111111, B00101110, B01010000, B11001111, B00111111, B11111110, B00000011, B00001000, B11110110, B10111111, B11111111, B11111110, B11111110, B11100000, B01001111, B10111111, B11111110, B00000000, B00000000, B00000000, B00111111, B11111111, B11111100, B11111100, B11100100, B01100111, B10011111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111101, B01111101, B11011110, B11100111, B01011111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111011, B11111101, B11111111, B01110110, B11011111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111011, B11111111, B01111111, B11111111, B11011111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111101, B11111110, B00111111, B10011111, B10111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111110, B00111111, B00001111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111100, B00111111, B10001111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111100, B00111111, B10001111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111100, B01111111, B11000111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11110010, B01111111, B11101011, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11000000, B11111111, B11111101, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11001100, B11111111, B11110110, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B10111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111101, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111,};
const byte Lvl1[] PROGMEM = {88, 48, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111100, B00000000, B00000000, B00000011, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111100, B00000000, B00000000, B00000011, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111100, B11000000, B01100000, B00100011, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111100, B01000000, B00100000, B01100011, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111100, B01000101, B00100000, B00100011, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111100, B01010101, B00100000, B00100011, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111100, B11110010, B00101000, B01110011, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111100, B00000000, B00000000, B00000011, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111100, B00000000, B00000000, B00000011, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B10101000, B00000000, B00000000, B00000101, B00100111, B11110011, B11111001, B00100010, B00000000, B00000100, B01011111, B10101000, B00000000, B00000000, B00000101, B00100000, B00000000, B00000001, B00100010, B00000000, B00000100, B01011111, B10111100, B00000000, B00000000, B00001111, B00100111, B11110011, B11111001, B00011100, B00000000, B00000011, B10011111, B10100100, B11111110, B00011111, B11001001, B00100100, B00010010, B00001001, B00001000, B00000000, B00000001, B00011111, B10100100, B10000010, B00010000, B01001001, B00100100, B00010010, B00001001, B00001000, B00000000, B00000001, B00011111, B10111000, B10000010, B00010000, B01000111, B00100100, B00010010, B00001001, B00001000, B00111111, B10000001, B00011111, B10101000, B10000010, B00010000, B01000101, B00100100, B00010010, B00001001, B00001000, B01000000, B01000001, B00011111, B10101000, B10000010, B00010000, B01000101, B00101111, B11111111, B11111101, B00001000, B10000011, B10100001, B00011111, B10111100, B10000010, B00010000, B01001111, B00101000, B00001100, B00000101, B00001000, B10000100, B01100001, B00011111, B10100101, B11111111, B00010000, B01001001, B00100111, B11110011, B11111001, B00001000, B11111111, B11100001, B00011111, B10100101, B00000001, B00010001, B01001001, B00100000, B00000000, B00000001, B00001001, B00000000, B00010001, B00011111, B10111000, B11111110, B00010001, B01000111, B00100000, B00000110, B00000001, B00001001, B01101010, B11010001, B00011111, B10101000, B00000000, B00010000, B01000101, B00100000, B00000011, B10000001, B00011101, B01110101, B11010011, B10011111, B10101000, B00000000, B00010000, B01000101, B00100000, B00001111, B10000001, B00011101, B00000000, B00010011, B10011111, B10111100, B00000000, B00010000, B01001111, B00100001, B11111111, B00000001, B00011100, B11111111, B11100011, B10011111, B10100100, B00000000, B00010000, B01001001, B00100001, B11111111, B11000001, B00011100, B11000000, B01100011, B10011111, B11111111, B11111111, B11111111, B11111111, B11111100, B10011101, B10101111, B11111111, B11111111, B11111111, B11111111, B10000000, B00000000, B00000000, B00000000, B00000001, B11111101, B00100000, B00000000, B00000000, B00000000, B00011111, B10000000, B00000000, B00000000, B00000000, B00000000, B01100000, B11000000, B00000000, B00000000, B00000000, B00011111, B10000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00011111, B10000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00011111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111,};
const byte Lvl2[] PROGMEM = {88, 48, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111100, B00000000, B00000000, B00000011, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111100, B00000000, B00000000, B00000011, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111100, B11000000, B01100000, B01100011, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111100, B01000000, B00100000, B00010011, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111100, B01000101, B00100000, B00100011, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111100, B01010101, B00100000, B01000011, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111100, B11110010, B00101000, B01110011, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111100, B00000000, B00000000, B00000011, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111100, B00000000, B00000000, B00000011, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11010101, B01010101, B00100001, B00000000, B00000000, B00000000, B00000000, B00000000, B00000011, B01010101, B01011111, B10101010, B10101011, B01000000, B10000000, B00000000, B00000000, B00000000, B00000000, B00000010, B10101010, B10111111, B11010101, B01010101, B11111111, B11000000, B00000000, B00000000, B00000000, B00000000, B00000011, B01010101, B01011111, B10101010, B10101011, B01000000, B10000000, B00000000, B00000000, B00000000, B00000000, B00000011, B10101010, B10111111, B11010101, B01010101, B01001110, B10000000, B00000000, B00000100, B00000000, B00000000, B00000001, B01010100, B11011111, B10101010, B10101011, B01001110, B10000000, B11111110, B00001010, B00000000, B00000000, B00000001, B10101100, B10111111, B11010011, B01010101, B01001110, B11000001, B10101010, B00001010, B00000000, B00000000, B00000001, B01010100, B11011111, B10110001, B10001010, B01001110, B10111110, B10101010, B00001111, B10000000, B00000000, B00000001, B10101100, B10111111, B11011000, B00110110, B01111111, B10101010, B11111110, B00011111, B11000000, B00000000, B00000000, B11011101, B11011111, B10101100, B01101100, B01001010, B11101011, B11111110, B00010100, B11100000, B00000000, B00000000, B00111001, B10111111, B11010100, B11011000, B01001110, B10111110, B10000010, B00111000, B01110000, B00000000, B11111110, B00001001, B01111111, B11101100, B11110000, B01001010, B10000000, B10000010, B00101000, B00111000, B00000001, B11111110, B00001001, B00011111, B10111100, B10000000, B01001110, B10000000, B10000010, B01110000, B00011100, B00000000, B10000100, B00001001, B00011111, B10000100, B10000000, B01001010, B10000000, B10000010, B01010000, B00001110, B00000011, B11111110, B00001000, B10011111, B10000100, B10000000, B01001110, B10000000, B10000010, B11100000, B00000111, B11100111, B11111110, B00011000, B10011111, B10000100, B10000000, B01001010, B10000000, B10000010, B10100000, B00000011, B11000010, B10010100, B00010000, B01011111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B10000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00011111, B10000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00011111, B10000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00011111, B10000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00011111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111,};
const byte Lvl3[] PROGMEM = {88, 48, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111110, B00000000, B00000000, B00000011, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111110, B00000000, B00000000, B00000011, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111110, B11000000, B01100000, B01100011, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111110, B01000000, B00100000, B00010011, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111110, B01000101, B00100000, B00100011, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111110, B01010101, B00100000, B00010011, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111110, B11110010, B00101000, B01100011, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111110, B00000000, B00000000, B00000011, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111110, B00000000, B00000000, B00000011, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B10010000, B10001000, B01000000, B10000000, B00000111, B01000001, B00001010, B10001011, B11100011, B11110010, B10011111, B10100000, B10000100, B00100000, B10000000, B00011010, B11000010, B00001100, B01010001, B11111111, B11110100, B01011111, B11000000, B10000010, B00010000, B10000000, B01110101, B01100100, B00001000, B00100000, B10111110, B00001000, B00111111, B10000000, B10000001, B00001111, B10000000, B10101010, B10111000, B00001100, B01010001, B01000101, B00010100, B00111111, B10000000, B10000000, B10000100, B10000000, B01111111, B11110000, B00001010, B10001010, B00101000, B10100011, B11111111, B10000001, B11100000, B11000010, B10000000, B00001000, B01000000, B00001001, B00000100, B00010000, B01000111, B11011111, B11000010, B00010011, B10100001, B00000000, B01111111, B11111100, B00111110, B10001010, B00101000, B10111111, B10111111, B11111111, B11111111, B00010000, B10000000, B10000000, B00000010, B01000001, B01010001, B01000101, B11111100, B00011111, B10111100, B00001100, B00001000, B01000000, B10111111, B11111010, B01011101, B00100000, B10000011, B11111111, B11111111, B10000100, B00001000, B00000100, B00100000, B10100000, B00001010, B01010101, B01010001, B01011111, B10011100, B00011111, B10000100, B00001000, B00000010, B00010000, B10100000, B00001010, B01010101, B10001010, B01111110, B00101010, B00111111, B10000111, B11111000, B00000001, B00001000, B10100000, B00001010, B01010101, B00000111, B11111001, B01001001, B01011111, B10000100, B00001000, B00000011, B11111110, B10100000, B00001010, B01010101, B10001111, B10001000, B10001000, B10011111, B10000100, B00001000, B00000010, B00000010, B10111111, B11111010, B01011101, B01111111, B01001001, B01001001, B01011111, B10000011, B11110000, B00000010, B00000010, B10000000, B00000010, B01000001, B11111010, B00101010, B00101010, B00111111, B10000000, B00000000, B00000010, B00000010, B10000000, B00000010, B01000001, B11001100, B00011100, B00011100, B00011111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B10000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00011111, B10000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00011111, B10000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00011111, B10000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00000000, B00011111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111,};
typedef enum player_contraints_ {
kPlayerContraintMaxHealth = 50, /* Every loop() cycle this is decreased by one if player is eaten by zombie. So it's pretty short time period you can withstand a zombies bite. */
kPlayerContraintMaxAmmo = 6,
} PlayerContraint;
//##### WorldInfo #####
int gameLevel;
int stage;
int startStage;
int endStage;
int tmpStartStage;
int xposScreen;
int xposWorld;
int worldSize;
int nbOfSprites;
int worldBackground[40];
int startGame;
//##### Info about Me #####
int xposMeInTheWorld;
int xposMe;
int yposMe;
int meSpeed;
int damage;
int ammo;
bool fire;
bool meDirection; //true: right false: left
bool meWalk; //legs position
bool meReload; //is reloading weapon
//##### Zombi Info #####
int nbOfZombi;
int nbOfAliveZombi;
int zombiInitialized;
int worldZombi[50][7];
void setup() {
gb.begin();
goTitleScreen();
}
void goTitleScreen() {
gb.battery.show = false;
gb.titleScreen(Welcome);
gameLevel = 0;
initGame();
}
void initGame() {
gb.battery.show = false;
//##### WorldInfo #####
gameLevel = gameLevel + 1;
stage = 1;
startStage = 0;
endStage = 0;
tmpStartStage = 0;
xposScreen = 0;
xposWorld = 0;
worldSize = 32;
nbOfSprites = 0;
startGame = 1;
//##### Info about Me #####
xposMeInTheWorld = 0;
xposMe = 0;
yposMe = 32;
meSpeed = 2;
damage = 0;
ammo = kPlayerContraintMaxAmmo;
fire = 0;
meDirection = false;
meWalk = true;
meReload = false;
//##### Zombi Info #####
nbOfZombi = 0;
nbOfAliveZombi = 0;
zombiInitialized = 1;
worldZombi[50][7];
//###############################################
if (gameLevel == 1) {
nbOfSprites = 20;
nbOfZombi = 5;
nbOfAliveZombi = 5;
worldBackground[0] = 1;
worldBackground[1] = 2;
worldBackground[2] = 3;
worldBackground[3] = 4;
worldBackground[4] = 5;
worldBackground[5] = 6;
worldBackground[6] = 3;
worldBackground[7] = 4;
worldBackground[8] = 5;
worldBackground[9] = 2;
worldBackground[10] = 6;
worldBackground[11] = 1;
worldBackground[12] = 4;
worldBackground[13] = 3;
worldBackground[14] = 5;
worldBackground[15] = 6;
worldBackground[16] = 2;
worldBackground[17] = 1;
worldBackground[18] = 3;
worldBackground[19] = 6;
}
if (gameLevel == 2) {
nbOfSprites = 36;
nbOfZombi = 8;
nbOfAliveZombi = 8;
worldBackground[0] = 17;
worldBackground[1] = 18;
worldBackground[2] = 19;
worldBackground[3] = 21;
worldBackground[4] = 20;
worldBackground[5] = 8;
worldBackground[6] = 22;
worldBackground[7] = 21;
worldBackground[8] = 19;
worldBackground[9] = 18;
worldBackground[10] = 21;
worldBackground[11] = 20;
worldBackground[12] = 24;
worldBackground[13] = 23;
worldBackground[14] = 25;
worldBackground[15] = 22;
worldBackground[16] = 21;
worldBackground[17] = 9;
worldBackground[18] = 20;
worldBackground[19] = 7;
worldBackground[20] = 9;
worldBackground[21] = 7;
worldBackground[22] = 22;
worldBackground[23] = 9;
worldBackground[24] = 8;
worldBackground[25] = 9;
worldBackground[26] = 20;
worldBackground[27] = 7,
worldBackground[28] = 21;
worldBackground[29] = 19;
worldBackground[30] = 18;
worldBackground[31] = 21;
worldBackground[32] = 20;
worldBackground[33] = 7;
worldBackground[34] = 7;
worldBackground[35] = 7;
}
if (gameLevel == 3) {
nbOfSprites = 32;
nbOfZombi = 10;
nbOfAliveZombi = 10;
worldBackground[0] = 9;
worldBackground[1] = 9;
worldBackground[2] = 9;
worldBackground[3] = 17;
worldBackground[4] = 9;
worldBackground[5] = 9;
worldBackground[6] = 9;
worldBackground[7] = 21;
worldBackground[8] = 7;
worldBackground[9] = 11;
worldBackground[10] = 7;
worldBackground[11] = 21;
worldBackground[12] = 18;
worldBackground[13] = 19;
worldBackground[14] = 16;
worldBackground[15] = 19;
worldBackground[16] = 18;
worldBackground[17] = 21;
worldBackground[18] = 20;
worldBackground[19] = 7;
worldBackground[20] = 22;
worldBackground[21] = 21;
worldBackground[22] = 12;
worldBackground[23] = 13;
worldBackground[24] = 14;
worldBackground[25] = 21;
worldBackground[26] = 9;
worldBackground[27] = 9;
worldBackground[28] = 15;
worldBackground[29] = 9;
worldBackground[30] = 9;
worldBackground[31] = 7;
}
for (int i = 0; i < nbOfSprites; i++) {
worldSize = worldSize + SprintSize[worldBackground[i]][0];
}
//###############################################
for (int j = 0; j < nbOfZombi; j++) {
//zombitype,etat,xpos,ypos,life,timer,direction
worldZombi[j][0] = 1;
worldZombi[j][1] = 1;
if (j < nbOfZombi / 2) {
worldZombi[j][2] = random(xposWorld - 50, xposWorld - 10);
}
else {
worldZombi[j][2] = random(xposWorld + 88, xposWorld + 138);
}
worldZombi[j][3] = random(15, 33);
worldZombi[j][4] = 2;
worldZombi[j][5] = 0;
worldZombi[j][6] = 0;
}
}
void loop() {
if (gb.update()) {
if (startGame == 1) {
if (gameLevel == 1) {
gb.display.drawBitmap(0, 0, Lvl1);
} else if (gameLevel == 2) {
gb.display.drawBitmap(0, 0, Lvl2);
} else if (gameLevel == 3) {
gb.display.drawBitmap(0, 0, Lvl3);
}
if (gb.buttons.pressed(BTN_A)) {
startGame = 0;
}
} else {
// --> 0 == startGame
if (gb.buttons.pressed(BTN_C)) {
goTitleScreen();
}
startStage = (stage - 1) * 120;
endStage = stage * 120;
if (endStage > worldSize) {
endStage = worldSize;
}
fire = 0;
if (gb.buttons.pressed(BTN_A) && ammo > 0) { //fire!
gb.sound.playTick();
fire = 1;
ammo--;
}
if (gb.buttons.repeat(BTN_RIGHT, 1) || gb.buttons.repeat(BTN_LEFT, 1) || gb.buttons.repeat(BTN_UP, 1) || gb.buttons.repeat(BTN_DOWN, 1)) {
if (meWalk == true) {
meWalk = false;
}
else {
meWalk = true;
}
}
if (gb.buttons.repeat(BTN_UP, 1)) {
if (yposMe > 15) {
yposMe = yposMe - meSpeed;
}
}
if (gb.buttons.repeat(BTN_DOWN, 1)) {
if (yposMe < 36) {
yposMe = yposMe + meSpeed;
}
}
if (gb.buttons.repeat(BTN_RIGHT, 1)) {
meDirection = 0;
if (xposMeInTheWorld > tmpStartStage + 40 && xposMeInTheWorld < endStage - 40 && xposWorld + 88 < endStage) {
xposMeInTheWorld = xposMeInTheWorld + meSpeed;
xposWorld = xposWorld + meSpeed;
if (tmpStartStage < startStage) {
tmpStartStage = tmpStartStage + meSpeed;
}
}
else {
if (xposMeInTheWorld + meSpeed <= endStage - 8) {
xposMeInTheWorld = xposMeInTheWorld + meSpeed;
xposMe = xposMe + meSpeed;
}
}
}
else {
if (gb.buttons.repeat(BTN_LEFT, 1)) {
meDirection = 1;
if (xposMeInTheWorld > tmpStartStage + 40 && xposMeInTheWorld < endStage - 40 && xposWorld > tmpStartStage) {
xposWorld = xposWorld - meSpeed;
xposMeInTheWorld = xposMeInTheWorld - meSpeed;
}
else {
if (xposMeInTheWorld + meSpeed >= tmpStartStage) {
xposMe = xposMe - meSpeed;
xposMeInTheWorld = xposMeInTheWorld - meSpeed;
}
}
}
}
if (gb.buttons.pressed(BTN_B) || meReload == true) {
meReload = false;
if (ammo < 6) {
meReload = true;
ammo++;
}
}
if (damage >= kPlayerContraintMaxHealth) {
gameOver();
}
if (xposMeInTheWorld + 16 > worldSize) {
if (gameLevel == 3) {
victory();
}
else {
initGame();
}
}
if (tmpStartStage < startStage) {
gb.display.cursorX = 30;
gb.display.cursorY = 38;
gb.display.println(F("Go =>"));
}
displayBackground();
if (tmpStartStage == startStage) {
displayZombi();
}
displayLevel();
displayAmmo(ammo);
displayHealth(damage);
drawMe();
}
}
}
void gameOver() {
while (true) {
if (gb.update()) {
gb.display.drawBitmap(0, 0, GameOver);
if (gb.buttons.pressed(BTN_B)) {
break;
}
}
}
goTitleScreen();
}
void victory() {
while (true) {
if (gb.update()) {
gb.display.drawBitmap(0, 0, Congratulation);
if (gb.buttons.pressed(BTN_B)) {
break;
}
}
}
goTitleScreen();
}
void drawMe() {
if (meReload == false) {
if (meDirection == 0) {
if (meWalk == true) {
gb.display.drawBitmap(xposMe + 2, yposMe + 10, MeLegs1);
}
else {
gb.display.drawBitmap(xposMe + 2, yposMe + 10, MeLegs2);
}
gb.display.drawBitmap(xposMe, yposMe, Me);
gb.display.drawBitmap(xposMe + 5, yposMe + 6, MeWeapon);
} else {
if (meWalk == true) {
gb.display.drawBitmap(xposMe - 3, yposMe + 10, MeLegs1, NOROT, FLIPH);
}
else {
gb.display.drawBitmap(xposMe - 3, yposMe + 10, MeLegs2, NOROT, FLIPH);
}
gb.display.drawBitmap(xposMe - 1, yposMe, Me, NOROT, FLIPH);
gb.display.drawBitmap(xposMe - 6, yposMe + 6, MeWeapon, NOROT, FLIPH);
}
} else {
if (meDirection == 0) {
if (meWalk == true) {
gb.display.drawBitmap(xposMe + 2, yposMe + 10, MeLegs1);
}
else {
gb.display.drawBitmap(xposMe + 2, yposMe + 10, MeLegs2);
}
gb.display.drawBitmap(xposMe, yposMe, Me);
gb.display.drawBitmap(xposMe + 6, yposMe, MeWeaponReload);
} else {
if (meWalk == true) {
gb.display.drawBitmap(xposMe - 3, yposMe + 10, MeLegs1, NOROT, FLIPH);
}
else {
gb.display.drawBitmap(xposMe - 3, yposMe + 10, MeLegs2, NOROT, FLIPH);
}
gb.display.drawBitmap(xposMe - 1, yposMe, Me, NOROT, FLIPH);
gb.display.drawBitmap(xposMe - 6, yposMe - 2, MeWeaponReload, NOROT, FLIPH);
}
}
}
//###############################################
void displayAmmo(int ammo) {
if (ammo == 0) {
gb.display.cursorX = 57;
gb.display.cursorY = 42;
gb.display.print(F("Reload!"));
}
else {
// Draw the bullet icon:
gb.display.drawPixel(64, 42); // Upper left corner og the icon
gb.display.drawPixel(64, 43); // Pixel per pixel going math. positive direction.
gb.display.drawPixel(65, 43);
gb.display.drawPixel(64, 44);
gb.display.drawPixel(65, 45);
gb.display.drawPixel(64, 45);
gb.display.drawPixel(64, 46);
gb.display.drawPixel(66, 46);
gb.display.drawPixel(67, 46);
gb.display.drawPixel(68, 46);
gb.display.drawPixel(69, 45);
gb.display.drawPixel(70, 44);
gb.display.drawPixel(69, 43);
gb.display.drawPixel(68, 42);
gb.display.drawPixel(67, 42);
gb.display.drawPixel(66, 42);
for (int i = 0; i < ammo; i++) {
gb.display.drawPixel((i * 2) + 72, 44);
gb.display.drawPixel((i * 2) + 72, 45);
}
}
}
//###############################################
void displayHealth(int health) {
static uint8_t step_health = 10;
// Draw the heart icon:
gb.display.drawPixel(1, 43);
gb.display.drawPixel(1, 44);
gb.display.drawPixel(2, 45);
gb.display.drawPixel(3, 46);
gb.display.drawPixel(4, 45);
gb.display.drawPixel(5, 44);
gb.display.drawPixel(5, 43);
gb.display.drawPixel(4, 42);
gb.display.drawPixel(3, 43);
gb.display.drawPixel(2, 42);
for (int i = 0; i < (kPlayerContraintMaxHealth - health); i += step_health) {
gb.display.drawPixel((i / step_health * 2) + 8, 44);
gb.display.drawPixel((i / step_health * 2) + 8, 45);
}
}
//###############################################
void displayLevel() {
gb.display.cursorX = 0;
gb.display.cursorY = 0;
gb.display.print(F("Lvl"));
gb.display.print(gameLevel);
gb.display.print(F("-"));
gb.display.print(stage);
}
//###############################################
void displayBackground() {
xposScreen = 0;
if (xposScreen - xposWorld + 16 > 0 && xposScreen - xposWorld < 88) {
gb.display.drawBitmap(xposScreen - xposWorld, 0 - 25, WorldStart);
}
xposScreen = xposScreen + 16;
int sprite = 0;
int spriteWidth = 0;
int spriteVertPos = 0;
for (int j = 0; j < nbOfSprites; j++) {
sprite = worldBackground[j];
spriteWidth = SprintSize[worldBackground[j]][0];
spriteVertPos = 19 - SprintSize[worldBackground[j]][1];
if (xposScreen - xposWorld + 88 > 0 && xposScreen - xposWorld < 88) {
switch (sprite) {
case 1:
gb.display.drawBitmap(xposScreen - xposWorld, spriteVertPos, Sprite01);
break;
case 2:
gb.display.drawBitmap(xposScreen - xposWorld, spriteVertPos, Sprite02);
break;
case 3:
gb.display.drawBitmap(xposScreen - xposWorld, spriteVertPos, Sprite03);
break;
case 4:
gb.display.drawBitmap(xposScreen - xposWorld, spriteVertPos, Sprite04);
break;
case 5:
gb.display.drawBitmap(xposScreen - xposWorld, spriteVertPos, Sprite05);
break;
case 6:
gb.display.drawBitmap(xposScreen - xposWorld, spriteVertPos, Sprite06);
break;
case 7:
gb.display.drawBitmap(xposScreen - xposWorld, spriteVertPos, Sprite07);
break;
case 8:
gb.display.drawBitmap(xposScreen - xposWorld, spriteVertPos, Sprite08);
break;
case 9:
gb.display.drawBitmap(xposScreen - xposWorld, spriteVertPos, Sprite09);
break;
case 11:
gb.display.drawBitmap(xposScreen - xposWorld, spriteVertPos, Sprite11);
break;
case 12:
gb.display.drawBitmap(xposScreen - xposWorld, spriteVertPos, Sprite12);
break;
case 13:
gb.display.drawBitmap(xposScreen - xposWorld, spriteVertPos, Sprite13);
break;
case 14:
gb.display.drawBitmap(xposScreen - xposWorld, spriteVertPos, Sprite14);
break;
case 15:
gb.display.drawBitmap(xposScreen - xposWorld, spriteVertPos, Sprite15);
break;
case 16:
gb.display.drawBitmap(xposScreen - xposWorld, spriteVertPos, Sprite16);
break;
case 17:
gb.display.drawBitmap(xposScreen - xposWorld, spriteVertPos, Sprite17);
break;
case 18:
gb.display.drawBitmap(xposScreen - xposWorld, spriteVertPos, Sprite18);
break;
case 19:
gb.display.drawBitmap(xposScreen - xposWorld, spriteVertPos, Sprite19);
break;
case 20:
gb.display.drawBitmap(xposScreen - xposWorld, spriteVertPos, Sprite20);
break;
case 21:
gb.display.drawBitmap(xposScreen - xposWorld, spriteVertPos, Sprite21);
break;
case 22:
gb.display.drawBitmap(xposScreen - xposWorld, spriteVertPos, Sprite22);
break;
case 23:
gb.display.drawBitmap(xposScreen - xposWorld, spriteVertPos, Sprite23);
break;
case 24:
gb.display.drawBitmap(xposScreen - xposWorld, spriteVertPos, Sprite24);
break;
case 25:
gb.display.drawBitmap(xposScreen - xposWorld, spriteVertPos, Sprite25);
break;
}
}
xposScreen = xposScreen + spriteWidth;
}
if (xposScreen - xposWorld + 16 > 0 && xposScreen - xposWorld < 88) {
gb.display.drawBitmap(xposScreen - xposWorld, 0 - 25, WorldEnd);
}
}
//###############################################
void displayZombi() {
if (nbOfAliveZombi == 0) {
stage = stage + 1;
tmpStartStage = xposWorld;
nbOfZombi = (stage + gameLevel) + 5;
nbOfAliveZombi = nbOfZombi;
for (int k = 0; k < nbOfZombi; k++) {
//zombitype,etat,xpos,ypos,life,timer,direction
worldZombi[k][0] = 1;
worldZombi[k][1] = 1;
if (k < nbOfZombi / 2) {
worldZombi[k][2] = random(((stage - 1) * 120) - 70, ((stage - 1) * 120));
}
else {
worldZombi[k][2] = random(((stage - 1) * 120) + 88, ((stage - 1) * 120) + 138);
}
worldZombi[k][3] = random(15, 33);
worldZombi[k][4] = 2;
worldZombi[k][5] = 0;
worldZombi[k][6] = 0;
}
if (stage == 2) {
worldZombi[nbOfZombi - 1][0] = 2;
worldZombi[nbOfZombi - 1][4] = 1;
}
if (stage == 3) {
worldZombi[nbOfZombi - 1][0] = 2;
worldZombi[nbOfZombi - 1][4] = 1;
worldZombi[nbOfZombi - 2][0] = 2;
worldZombi[nbOfZombi - 2][4] = 1;
worldZombi[nbOfZombi - 3][0] = 2;
worldZombi[nbOfZombi - 3][4] = 1;
}
if (stage == 4) {
worldZombi[nbOfZombi - 1][0] = 3;
worldZombi[nbOfZombi - 1][4] = 18;
worldZombi[nbOfZombi - 2][0] = 2;
worldZombi[nbOfZombi - 2][4] = 1;
worldZombi[nbOfZombi - 3][0] = 2;
worldZombi[nbOfZombi - 3][4] = 1;
worldZombi[nbOfZombi - 4][0] = 2;
worldZombi[nbOfZombi - 4][4] = 1;
}
if (stage == 5) {
worldZombi[0][0] = 2;
worldZombi[0][4] = 1;
worldZombi[1][0] = 2;
worldZombi[1][4] = 1;
worldZombi[2][0] = 3;
worldZombi[2][2] = ((stage - 1) * 120) - 35;
worldZombi[2][4] = 18;
worldZombi[nbOfZombi - 1][0] = 3;
worldZombi[nbOfZombi - 1][2] = ((stage - 1) * 120) + 88 + 35;
worldZombi[nbOfZombi - 1][4] = 18;
worldZombi[nbOfZombi - 2][0] = 2;
worldZombi[nbOfZombi - 2][4] = 1;
worldZombi[nbOfZombi - 3][0] = 2;
worldZombi[nbOfZombi - 3][4] = 1;
}
} else {
//zombitype,etat,xpos,ypos,life
int zombiType = 0;
int zombiStatus = 0;
int zombixpos = 0;
int zombiypos = 0;
int zombiLife = 0;
int zombiTimer = 0;
int zombiDirection = 0;
int zombiToKill = 999;
int zombiDistance = 999;
for (int j = 0; j < nbOfZombi; j++) {
zombiType = worldZombi[j][0];
zombiStatus = worldZombi[j][1];
zombixpos = worldZombi[j][2];
zombiypos = worldZombi[j][3];
zombiLife = worldZombi[j][4];
zombiTimer = worldZombi[j][5];
//##### ZOMBI 01 WALK #####
if (zombiType == 1) {
if (worldZombi[j][1] != 6) {
if (zombiTimer == 0 ) {
worldZombi[j][5] = 2; //zombiSpeed
if (zombixpos >= xposMeInTheWorld) {
worldZombi[j][2] = worldZombi[j][2] - 1;
worldZombi[j][6] = 0;
}
if (zombixpos < xposMeInTheWorld) {
worldZombi[j][2] = worldZombi[j][2] + 1;
worldZombi[j][6] = 1;
}
if (zombiypos >= yposMe && abs(zombixpos - xposMeInTheWorld) < 15) {
worldZombi[j][3] = worldZombi[j][3] - 1;
}
if (zombiypos < yposMe && abs(zombixpos - xposMeInTheWorld) < 15) {
worldZombi[j][3] = worldZombi[j][3] + 1;
}
} else {
worldZombi[j][5] = worldZombi[j][5] - 1;
if (worldZombi[j][1] == 5 && worldZombi[j][5] == 0) {
worldZombi[j][1] = 1;
}
}
}
//##### ZOMBI 01 DISPLAY #####
if (zombixpos - xposWorld + 8 > 0 && zombixpos - xposWorld < 88) {
if (zombiStatus == 5 && (zombiTimer == 7 || zombiTimer == 5 || zombiTimer == 3 || zombiTimer == 1)) {
//Do nothing
} else {
if (zombiStatus == 6) {
gb.display.drawBitmap(zombixpos - xposWorld, zombiypos + 10, ZombiDead);
}
else {
if (worldZombi[j][6] == 0) {
gb.display.drawBitmap(zombixpos - xposWorld, zombiypos, Zombi);
}
else {
gb.display.drawBitmap(zombixpos - xposWorld, zombiypos, Zombi, NOROT, FLIPH);
}
}
}
if (yposMe + 7 > zombiypos && yposMe + 7 < zombiypos + 12) {
//I shoot the Zombi
if (fire == 1 && zombiStatus != 6) {
if (zombixpos - xposMeInTheWorld > 0 && zombixpos - xposMeInTheWorld < zombiDistance && meDirection == false) {
zombiToKill = j;
zombiDistance = zombixpos - xposMeInTheWorld;
}
if (xposMeInTheWorld - zombixpos > 0 && xposMeInTheWorld - zombixpos < zombiDistance && meDirection == true) {
zombiToKill = j;
zombiDistance = xposMeInTheWorld - zombixpos;
}
}
//Zombi eat Me
if (xposMeInTheWorld + 6 > zombixpos + 1 && xposMeInTheWorld < zombixpos + 7 && zombiStatus != 6) {
damage = damage + 1;
}
}
}
}
//##### ZOMBI 02 WALK #####
if (zombiType == 2) {
if (worldZombi[j][1] != 6) {
if (zombiTimer == 0 ) {
worldZombi[j][5] = 1; //zombiSpeed
if (zombixpos >= xposMeInTheWorld) {
worldZombi[j][2] = worldZombi[j][2] - 2;
worldZombi[j][6] = 0;
}
if (zombixpos < xposMeInTheWorld) {
worldZombi[j][2] = worldZombi[j][2] + 2;
worldZombi[j][6] = 1;
}
if (zombiypos >= yposMe && abs(zombixpos - xposMeInTheWorld) < 15) {
worldZombi[j][3] = worldZombi[j][3] - 2;
}
if (zombiypos < yposMe && abs(zombixpos - xposMeInTheWorld) < 15) {
worldZombi[j][3] = worldZombi[j][3] + 2;
}
} else {
worldZombi[j][5] = worldZombi[j][5] - 1;
if (worldZombi[j][1] == 5 && worldZombi[j][5] == 0) {
worldZombi[j][1] = 1;
}
}
}
//##### ZOMBI 02 DISPLAY #####
if (zombixpos - xposWorld + 8 > 0 && zombixpos - xposWorld < 88) {
if (zombiStatus == 5 && (zombiTimer == 7 || zombiTimer == 5 || zombiTimer == 3 || zombiTimer == 1)) {
//Do nothing
} else {
if (zombiStatus == 6) {
gb.display.drawBitmap(zombixpos - xposWorld, zombiypos + 10, ZombiDead);
}
else {
if (worldZombi[j][6] == 0) {
gb.display.drawBitmap(zombixpos - xposWorld, zombiypos, ZombiSpeed);
}
else {
gb.display.drawBitmap(zombixpos - xposWorld, zombiypos, ZombiSpeed, NOROT, FLIPH);
}
}
}
if (yposMe + 7 > zombiypos && yposMe + 7 < zombiypos + 8) {
//I shoot the Zombi
if (fire == 1 && zombiStatus != 6) {
if (zombixpos - xposMeInTheWorld > 0 && zombixpos - xposMeInTheWorld < zombiDistance && meDirection == false) {
zombiToKill = j;
zombiDistance = zombixpos - xposMeInTheWorld;
}
if (xposMeInTheWorld - zombixpos > 0 && xposMeInTheWorld - zombixpos < zombiDistance && meDirection == true) {
zombiToKill = j;
zombiDistance = xposMeInTheWorld - zombixpos;
}
}
//Zombi eat Me
if (xposMeInTheWorld + 6 > zombixpos + 3 && xposMeInTheWorld < zombixpos + 5 && zombiStatus != 6) {
damage = damage + 1;
}
}
}
}
//##### ZOMBI 03 WALK #####
if (zombiType == 3) {
if (worldZombi[j][1] != 6) {
if (zombiTimer == 0 ) {
worldZombi[j][5] = 2; //zombiSpeed
if (zombiLife > 8) {
worldZombi[j][5] = 4;
}
if (zombiLife > 10) {
worldZombi[j][5] = 6;
}
if (zombiLife > 12) {
worldZombi[j][5] = 8;
}
if (zombiLife > 14) {
worldZombi[j][5] = 10;
}
if (zombixpos >= xposMeInTheWorld) {
worldZombi[j][2] = worldZombi[j][2] - 2;
worldZombi[j][6] = 0;
}
if (zombixpos < xposMeInTheWorld) {
worldZombi[j][2] = worldZombi[j][2] + 2;
worldZombi[j][6] = 1;
}
if (zombiypos >= yposMe && abs(zombixpos - xposMeInTheWorld) < 15) {
worldZombi[j][3] = worldZombi[j][3] - 2;
}
if (zombiypos < yposMe && abs(zombixpos - xposMeInTheWorld) < 15) {
worldZombi[j][3] = worldZombi[j][3] + 2;
}
} else {
worldZombi[j][5] = worldZombi[j][5] - 1;
if (worldZombi[j][1] == 5 && worldZombi[j][5] == 0) {
worldZombi[j][1] = 1;
}
}
}
//##### ZOMBI 03 DISPLAY #####
if (zombixpos - xposWorld + 8 > 0 && zombixpos - xposWorld < 88) {
if (zombiStatus == 5 && (zombiTimer == 7 || zombiTimer == 5 || zombiTimer == 3 || zombiTimer == 1)) {
//Do nothing
} else {
if (zombiStatus == 6) {
gb.display.drawBitmap(zombixpos - xposWorld, zombiypos + 10, ZombiDead);
}
else {
if (worldZombi[j][6] == 0) {
gb.display.drawBitmap(zombixpos - xposWorld, zombiypos, ZombiBig);
}
else {
gb.display.drawBitmap(zombixpos - xposWorld, zombiypos, ZombiBig, NOROT, FLIPH);
}
}
}
if (yposMe + 7 > zombiypos + 2 && yposMe + 7 < zombiypos + 14) {
//I shoot the Zombi
if (fire == 1 && zombiStatus != 6) {
if (zombixpos - xposMeInTheWorld > 0 && zombixpos - xposMeInTheWorld < zombiDistance && meDirection == false) {
zombiToKill = j;
zombiDistance = zombixpos - xposMeInTheWorld;
}
if (xposMeInTheWorld - zombixpos > 0 && xposMeInTheWorld - zombixpos < zombiDistance && meDirection == true) {
zombiToKill = j;
zombiDistance = xposMeInTheWorld - zombixpos;
}
}
//Zombi eat Me
if (xposMeInTheWorld + 6 > zombixpos + 3 && xposMeInTheWorld < zombixpos + 5 && zombiStatus != 6) {
damage = damage + 1;
}
}
}
}
}
if (fire == 1 && zombiToKill < 999)
{
if (worldZombi[zombiToKill][1] != 5) {
worldZombi[zombiToKill][4] = worldZombi[zombiToKill][4] - 1;
if (worldZombi[zombiToKill][4] == 0) { //dead
worldZombi[zombiToKill][1] = 6;
nbOfAliveZombi = nbOfAliveZombi - 1;
} else {
worldZombi[zombiToKill][1] = 5;
worldZombi[zombiToKill][5] = 7;
}
}
}
}
}