Finished Lab 4 Pt 1
Dependencies: mbed Sounds PinDetect
LCDGraphics/BuzzyGraphics.h@0:daf9e2f8e1a1, 2019-04-05 (annotated)
- Committer:
- trmontgomery
- Date:
- Fri Apr 05 19:46:26 2019 +0000
- Revision:
- 0:daf9e2f8e1a1
Finished Lab 4 pt 1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
trmontgomery | 0:daf9e2f8e1a1 | 1 | #pragma once |
trmontgomery | 0:daf9e2f8e1a1 | 2 | |
trmontgomery | 0:daf9e2f8e1a1 | 3 | #define WHITE 0xFFFFFF |
trmontgomery | 0:daf9e2f8e1a1 | 4 | #define BLACK 0x000000 |
trmontgomery | 0:daf9e2f8e1a1 | 5 | #define _RED_ 0xFF0000 |
trmontgomery | 0:daf9e2f8e1a1 | 6 | #define GREEN 0x00FF00 |
trmontgomery | 0:daf9e2f8e1a1 | 7 | #define _BLUE 0x0000FF |
trmontgomery | 0:daf9e2f8e1a1 | 8 | #define LGREY 0xBFBFBF |
trmontgomery | 0:daf9e2f8e1a1 | 9 | #define DGREY 0x5F5F5F |
trmontgomery | 0:daf9e2f8e1a1 | 10 | |
trmontgomery | 0:daf9e2f8e1a1 | 11 | #define YELLW 0xFFFF00 |
trmontgomery | 0:daf9e2f8e1a1 | 12 | #define LBLUE 0x00FFFF |
trmontgomery | 0:daf9e2f8e1a1 | 13 | #define _PINK 0xFF80FF |
trmontgomery | 0:daf9e2f8e1a1 | 14 | #define VIOLT 0x8080FF |
trmontgomery | 0:daf9e2f8e1a1 | 15 | #define LGREN 0x80FF00 |
trmontgomery | 0:daf9e2f8e1a1 | 16 | #define LPECH 0xF78D4C |
trmontgomery | 0:daf9e2f8e1a1 | 17 | #define DPECH 0xC96830 |
trmontgomery | 0:daf9e2f8e1a1 | 18 | #define RPECH 0xF25427 |
trmontgomery | 0:daf9e2f8e1a1 | 19 | |
trmontgomery | 0:daf9e2f8e1a1 | 20 | /////////////////////////////// |
trmontgomery | 0:daf9e2f8e1a1 | 21 | /////////////////////////////// |
trmontgomery | 0:daf9e2f8e1a1 | 22 | // Tiles |
trmontgomery | 0:daf9e2f8e1a1 | 23 | const int TrapLine[9][9] = |
trmontgomery | 0:daf9e2f8e1a1 | 24 | { |
trmontgomery | 0:daf9e2f8e1a1 | 25 | {BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 26 | {BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 27 | {BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 28 | {BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 29 | {_PINK, _PINK, _PINK, _PINK, _PINK, _PINK, _PINK, _PINK, _PINK}, |
trmontgomery | 0:daf9e2f8e1a1 | 30 | {_PINK, _PINK, _PINK, _PINK, _PINK, _PINK, _PINK, _PINK, _PINK}, |
trmontgomery | 0:daf9e2f8e1a1 | 31 | {BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 32 | {BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 33 | {BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK} |
trmontgomery | 0:daf9e2f8e1a1 | 34 | }; |
trmontgomery | 0:daf9e2f8e1a1 | 35 | const int FruitIcon[9][9] = |
trmontgomery | 0:daf9e2f8e1a1 | 36 | { |
trmontgomery | 0:daf9e2f8e1a1 | 37 | {BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 38 | {BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 39 | {BLACK, BLACK, BLACK, YELLW, YELLW, BLACK, BLACK, BLACK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 40 | {BLACK, BLACK, YELLW, YELLW, YELLW, YELLW, YELLW, BLACK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 41 | {BLACK, BLACK, YELLW, YELLW, YELLW, YELLW, YELLW, BLACK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 42 | {BLACK, BLACK, YELLW, YELLW, YELLW, YELLW, YELLW, BLACK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 43 | {BLACK, BLACK, BLACK, YELLW, YELLW, YELLW, BLACK, BLACK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 44 | {BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 45 | {BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK} |
trmontgomery | 0:daf9e2f8e1a1 | 46 | }; |
trmontgomery | 0:daf9e2f8e1a1 | 47 | const int PowerUpIcon[9][9] = |
trmontgomery | 0:daf9e2f8e1a1 | 48 | { |
trmontgomery | 0:daf9e2f8e1a1 | 49 | {BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 50 | {BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 51 | {BLACK, BLACK, BLACK, _RED_, _RED_, BLACK, BLACK, BLACK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 52 | {BLACK, BLACK, _RED_, _RED_, _RED_, _RED_, _RED_, BLACK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 53 | {BLACK, BLACK, _RED_, _RED_, _RED_, _RED_, _RED_, BLACK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 54 | {BLACK, BLACK, _RED_, _RED_, _RED_, _RED_, _RED_, BLACK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 55 | {BLACK, BLACK, BLACK, _RED_, _RED_, _RED_, BLACK, BLACK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 56 | {BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 57 | {BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK} |
trmontgomery | 0:daf9e2f8e1a1 | 58 | }; |
trmontgomery | 0:daf9e2f8e1a1 | 59 | const int HoneyDropIcon[3][3] = |
trmontgomery | 0:daf9e2f8e1a1 | 60 | { |
trmontgomery | 0:daf9e2f8e1a1 | 61 | {BLACK, YELLW, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 62 | {YELLW, YELLW, YELLW}, |
trmontgomery | 0:daf9e2f8e1a1 | 63 | {BLACK, YELLW, BLACK} |
trmontgomery | 0:daf9e2f8e1a1 | 64 | }; |
trmontgomery | 0:daf9e2f8e1a1 | 65 | /////////////////////////////// |
trmontgomery | 0:daf9e2f8e1a1 | 66 | /////////////////////////////// |
trmontgomery | 0:daf9e2f8e1a1 | 67 | // PacMan |
trmontgomery | 0:daf9e2f8e1a1 | 68 | const int BuzzyIcon[3][9][9] = |
trmontgomery | 0:daf9e2f8e1a1 | 69 | { |
trmontgomery | 0:daf9e2f8e1a1 | 70 | { |
trmontgomery | 0:daf9e2f8e1a1 | 71 | {BLACK, BLACK, BLACK, YELLW, YELLW, YELLW, BLACK, BLACK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 72 | {BLACK, YELLW, YELLW, YELLW, YELLW, YELLW, YELLW, YELLW, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 73 | {BLACK, YELLW, YELLW, YELLW, YELLW, BLACK, YELLW, YELLW, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 74 | {YELLW, YELLW, YELLW, YELLW, YELLW, YELLW, YELLW, YELLW, YELLW}, |
trmontgomery | 0:daf9e2f8e1a1 | 75 | {YELLW, YELLW, YELLW, YELLW, YELLW, YELLW, YELLW, YELLW, YELLW}, |
trmontgomery | 0:daf9e2f8e1a1 | 76 | {YELLW, YELLW, YELLW, YELLW, YELLW, YELLW, YELLW, YELLW, YELLW}, |
trmontgomery | 0:daf9e2f8e1a1 | 77 | {BLACK, YELLW, YELLW, YELLW, YELLW, YELLW, YELLW, YELLW, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 78 | {BLACK, YELLW, YELLW, YELLW, YELLW, YELLW, YELLW, YELLW, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 79 | {BLACK, BLACK, BLACK, YELLW, YELLW, YELLW, BLACK, BLACK, BLACK} |
trmontgomery | 0:daf9e2f8e1a1 | 80 | }, |
trmontgomery | 0:daf9e2f8e1a1 | 81 | { |
trmontgomery | 0:daf9e2f8e1a1 | 82 | {BLACK, BLACK, BLACK, YELLW, YELLW, YELLW, BLACK, BLACK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 83 | {BLACK, YELLW, YELLW, YELLW, YELLW, YELLW, YELLW, YELLW, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 84 | {BLACK, YELLW, YELLW, YELLW, YELLW, BLACK, YELLW, YELLW, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 85 | {YELLW, YELLW, YELLW, YELLW, YELLW, YELLW, YELLW, BLACK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 86 | {YELLW, YELLW, YELLW, YELLW, YELLW, YELLW, YELLW, BLACK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 87 | {YELLW, YELLW, YELLW, YELLW, YELLW, YELLW, YELLW, BLACK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 88 | {BLACK, YELLW, YELLW, YELLW, YELLW, YELLW, YELLW, YELLW, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 89 | {BLACK, YELLW, YELLW, YELLW, YELLW, YELLW, YELLW, YELLW, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 90 | {BLACK, BLACK, BLACK, YELLW, YELLW, YELLW, BLACK, BLACK, BLACK} |
trmontgomery | 0:daf9e2f8e1a1 | 91 | }, |
trmontgomery | 0:daf9e2f8e1a1 | 92 | { |
trmontgomery | 0:daf9e2f8e1a1 | 93 | {BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 94 | {BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 95 | {BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 96 | {BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 97 | {BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 98 | {BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 99 | {BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 100 | {BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 101 | {BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK, BLACK} |
trmontgomery | 0:daf9e2f8e1a1 | 102 | } |
trmontgomery | 0:daf9e2f8e1a1 | 103 | |
trmontgomery | 0:daf9e2f8e1a1 | 104 | }; |
trmontgomery | 0:daf9e2f8e1a1 | 105 | |
trmontgomery | 0:daf9e2f8e1a1 | 106 | /////////////////////////////// |
trmontgomery | 0:daf9e2f8e1a1 | 107 | /////////////////////////////// |
trmontgomery | 0:daf9e2f8e1a1 | 108 | // Ghosts |
trmontgomery | 0:daf9e2f8e1a1 | 109 | const int VioletGhost[2][9][9] = |
trmontgomery | 0:daf9e2f8e1a1 | 110 | { |
trmontgomery | 0:daf9e2f8e1a1 | 111 | { |
trmontgomery | 0:daf9e2f8e1a1 | 112 | {BLACK, BLACK, BLACK, VIOLT, VIOLT, VIOLT, BLACK, BLACK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 113 | {BLACK, VIOLT, VIOLT, VIOLT, VIOLT, VIOLT, VIOLT, VIOLT, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 114 | {BLACK, VIOLT, WHITE, BLACK, VIOLT, WHITE, BLACK, VIOLT, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 115 | {BLACK, VIOLT, WHITE, WHITE, VIOLT, WHITE, WHITE, VIOLT, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 116 | {BLACK, VIOLT, VIOLT, VIOLT, VIOLT, VIOLT, VIOLT, VIOLT, VIOLT}, |
trmontgomery | 0:daf9e2f8e1a1 | 117 | {VIOLT, VIOLT, VIOLT, VIOLT, VIOLT, VIOLT, VIOLT, VIOLT, VIOLT}, |
trmontgomery | 0:daf9e2f8e1a1 | 118 | {VIOLT, VIOLT, VIOLT, VIOLT, VIOLT, VIOLT, VIOLT, VIOLT, VIOLT}, |
trmontgomery | 0:daf9e2f8e1a1 | 119 | {VIOLT, VIOLT, BLACK, VIOLT, VIOLT, VIOLT, BLACK, VIOLT, VIOLT}, |
trmontgomery | 0:daf9e2f8e1a1 | 120 | {VIOLT, BLACK, BLACK, BLACK, VIOLT, BLACK, BLACK, BLACK, VIOLT} |
trmontgomery | 0:daf9e2f8e1a1 | 121 | }, |
trmontgomery | 0:daf9e2f8e1a1 | 122 | { |
trmontgomery | 0:daf9e2f8e1a1 | 123 | {BLACK, BLACK, BLACK, VIOLT, VIOLT, VIOLT, BLACK, BLACK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 124 | {BLACK, VIOLT, VIOLT, VIOLT, VIOLT, VIOLT, VIOLT, VIOLT, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 125 | {BLACK, VIOLT, BLACK, WHITE, VIOLT, BLACK, WHITE, VIOLT, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 126 | {BLACK, VIOLT, WHITE, WHITE, VIOLT, WHITE, WHITE, VIOLT, VIOLT}, |
trmontgomery | 0:daf9e2f8e1a1 | 127 | {BLACK, VIOLT, VIOLT, VIOLT, VIOLT, VIOLT, VIOLT, VIOLT, VIOLT}, |
trmontgomery | 0:daf9e2f8e1a1 | 128 | {VIOLT, VIOLT, VIOLT, VIOLT, VIOLT, VIOLT, VIOLT, VIOLT, VIOLT}, |
trmontgomery | 0:daf9e2f8e1a1 | 129 | {VIOLT, VIOLT, VIOLT, VIOLT, VIOLT, VIOLT, VIOLT, VIOLT, VIOLT}, |
trmontgomery | 0:daf9e2f8e1a1 | 130 | {VIOLT, VIOLT, VIOLT, VIOLT, VIOLT, VIOLT, VIOLT, VIOLT, VIOLT}, |
trmontgomery | 0:daf9e2f8e1a1 | 131 | {VIOLT, BLACK, BLACK, BLACK, VIOLT, BLACK, BLACK, BLACK, VIOLT} |
trmontgomery | 0:daf9e2f8e1a1 | 132 | }, |
trmontgomery | 0:daf9e2f8e1a1 | 133 | |
trmontgomery | 0:daf9e2f8e1a1 | 134 | }; |
trmontgomery | 0:daf9e2f8e1a1 | 135 | const int BlueGhost[2][9][9] = |
trmontgomery | 0:daf9e2f8e1a1 | 136 | { |
trmontgomery | 0:daf9e2f8e1a1 | 137 | { |
trmontgomery | 0:daf9e2f8e1a1 | 138 | {BLACK, BLACK, BLACK, LBLUE, LBLUE, LBLUE, BLACK, BLACK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 139 | {BLACK, LBLUE, LBLUE, LBLUE, LBLUE, LBLUE, LBLUE, LBLUE, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 140 | {BLACK, LBLUE, WHITE, BLACK, LBLUE, WHITE, BLACK, LBLUE, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 141 | {BLACK, LBLUE, WHITE, WHITE, LBLUE, WHITE, WHITE, LBLUE, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 142 | {BLACK, LBLUE, LBLUE, LBLUE, LBLUE, LBLUE, LBLUE, LBLUE, LBLUE}, |
trmontgomery | 0:daf9e2f8e1a1 | 143 | {LBLUE, LBLUE, LBLUE, LBLUE, LBLUE, LBLUE, LBLUE, LBLUE, LBLUE}, |
trmontgomery | 0:daf9e2f8e1a1 | 144 | {LBLUE, LBLUE, LBLUE, LBLUE, LBLUE, LBLUE, LBLUE, LBLUE, LBLUE}, |
trmontgomery | 0:daf9e2f8e1a1 | 145 | {LBLUE, LBLUE, BLACK, LBLUE, LBLUE, LBLUE, BLACK, LBLUE, LBLUE}, |
trmontgomery | 0:daf9e2f8e1a1 | 146 | {LBLUE, BLACK, BLACK, BLACK, LBLUE, BLACK, BLACK, BLACK, LBLUE} |
trmontgomery | 0:daf9e2f8e1a1 | 147 | }, |
trmontgomery | 0:daf9e2f8e1a1 | 148 | { |
trmontgomery | 0:daf9e2f8e1a1 | 149 | {BLACK, BLACK, BLACK, LBLUE, LBLUE, LBLUE, BLACK, BLACK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 150 | {BLACK, LBLUE, LBLUE, LBLUE, LBLUE, LBLUE, LBLUE, LBLUE, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 151 | {BLACK, LBLUE, BLACK, WHITE, LBLUE, BLACK, WHITE, LBLUE, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 152 | {BLACK, LBLUE, WHITE, WHITE, LBLUE, WHITE, WHITE, LBLUE, LBLUE}, |
trmontgomery | 0:daf9e2f8e1a1 | 153 | {BLACK, LBLUE, LBLUE, LBLUE, LBLUE, LBLUE, LBLUE, LBLUE, LBLUE}, |
trmontgomery | 0:daf9e2f8e1a1 | 154 | {LBLUE, LBLUE, LBLUE, LBLUE, LBLUE, LBLUE, LBLUE, LBLUE, LBLUE}, |
trmontgomery | 0:daf9e2f8e1a1 | 155 | {LBLUE, LBLUE, LBLUE, LBLUE, LBLUE, LBLUE, LBLUE, LBLUE, LBLUE}, |
trmontgomery | 0:daf9e2f8e1a1 | 156 | {LBLUE, LBLUE, LBLUE, LBLUE, LBLUE, LBLUE, LBLUE, LBLUE, LBLUE}, |
trmontgomery | 0:daf9e2f8e1a1 | 157 | {LBLUE, BLACK, BLACK, BLACK, LBLUE, BLACK, BLACK, BLACK, LBLUE} |
trmontgomery | 0:daf9e2f8e1a1 | 158 | }, |
trmontgomery | 0:daf9e2f8e1a1 | 159 | |
trmontgomery | 0:daf9e2f8e1a1 | 160 | }; |
trmontgomery | 0:daf9e2f8e1a1 | 161 | const int PinkGhost[2][9][9] = |
trmontgomery | 0:daf9e2f8e1a1 | 162 | { |
trmontgomery | 0:daf9e2f8e1a1 | 163 | { |
trmontgomery | 0:daf9e2f8e1a1 | 164 | {BLACK, BLACK, BLACK, _PINK, _PINK, _PINK, BLACK, BLACK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 165 | {BLACK, _PINK, _PINK, _PINK, _PINK, _PINK, _PINK, _PINK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 166 | {BLACK, _PINK, WHITE, BLACK, _PINK, WHITE, BLACK, _PINK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 167 | {BLACK, _PINK, WHITE, WHITE, _PINK, WHITE, WHITE, _PINK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 168 | {BLACK, _PINK, _PINK, _PINK, _PINK, _PINK, _PINK, _PINK, _PINK}, |
trmontgomery | 0:daf9e2f8e1a1 | 169 | {_PINK, _PINK, _PINK, _PINK, _PINK, _PINK, _PINK, _PINK, _PINK}, |
trmontgomery | 0:daf9e2f8e1a1 | 170 | {_PINK, _PINK, _PINK, _PINK, _PINK, _PINK, _PINK, _PINK, _PINK}, |
trmontgomery | 0:daf9e2f8e1a1 | 171 | {_PINK, _PINK, BLACK, _PINK, _PINK, _PINK, BLACK, _PINK, _PINK}, |
trmontgomery | 0:daf9e2f8e1a1 | 172 | {_PINK, BLACK, BLACK, BLACK, _PINK, BLACK, BLACK, BLACK, _PINK} |
trmontgomery | 0:daf9e2f8e1a1 | 173 | }, |
trmontgomery | 0:daf9e2f8e1a1 | 174 | { |
trmontgomery | 0:daf9e2f8e1a1 | 175 | {BLACK, BLACK, BLACK, _PINK, _PINK, _PINK, BLACK, BLACK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 176 | {BLACK, _PINK, _PINK, _PINK, _PINK, _PINK, _PINK, _PINK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 177 | {BLACK, _PINK, BLACK, WHITE, _PINK, BLACK, WHITE, _PINK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 178 | {BLACK, _PINK, WHITE, WHITE, _PINK, WHITE, WHITE, _PINK, _PINK}, |
trmontgomery | 0:daf9e2f8e1a1 | 179 | {BLACK, _PINK, _PINK, _PINK, _PINK, _PINK, _PINK, _PINK, _PINK}, |
trmontgomery | 0:daf9e2f8e1a1 | 180 | {_PINK, _PINK, _PINK, _PINK, _PINK, _PINK, _PINK, _PINK, _PINK}, |
trmontgomery | 0:daf9e2f8e1a1 | 181 | {_PINK, _PINK, _PINK, _PINK, _PINK, _PINK, _PINK, _PINK, _PINK}, |
trmontgomery | 0:daf9e2f8e1a1 | 182 | {_PINK, _PINK, _PINK, _PINK, _PINK, _PINK, _PINK, _PINK, _PINK}, |
trmontgomery | 0:daf9e2f8e1a1 | 183 | {_PINK, BLACK, BLACK, BLACK, _PINK, BLACK, BLACK, BLACK, _PINK} |
trmontgomery | 0:daf9e2f8e1a1 | 184 | }, |
trmontgomery | 0:daf9e2f8e1a1 | 185 | |
trmontgomery | 0:daf9e2f8e1a1 | 186 | }; |
trmontgomery | 0:daf9e2f8e1a1 | 187 | const int GreenGhost[2][9][9] = |
trmontgomery | 0:daf9e2f8e1a1 | 188 | { |
trmontgomery | 0:daf9e2f8e1a1 | 189 | { |
trmontgomery | 0:daf9e2f8e1a1 | 190 | {BLACK, BLACK, BLACK, LGREN, LGREN, LGREN, BLACK, BLACK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 191 | {BLACK, LGREN, LGREN, LGREN, LGREN, LGREN, LGREN, LGREN, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 192 | {BLACK, LGREN, WHITE, BLACK, LGREN, WHITE, BLACK, LGREN, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 193 | {BLACK, LGREN, WHITE, WHITE, LGREN, WHITE, WHITE, LGREN, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 194 | {BLACK, LGREN, LGREN, LGREN, LGREN, LGREN, LGREN, LGREN, LGREN}, |
trmontgomery | 0:daf9e2f8e1a1 | 195 | {LGREN, LGREN, LGREN, LGREN, LGREN, LGREN, LGREN, LGREN, LGREN}, |
trmontgomery | 0:daf9e2f8e1a1 | 196 | {LGREN, LGREN, LGREN, LGREN, LGREN, LGREN, LGREN, LGREN, LGREN}, |
trmontgomery | 0:daf9e2f8e1a1 | 197 | {LGREN, LGREN, BLACK, LGREN, LGREN, LGREN, BLACK, LGREN, LGREN}, |
trmontgomery | 0:daf9e2f8e1a1 | 198 | {LGREN, BLACK, BLACK, BLACK, LGREN, BLACK, BLACK, BLACK, LGREN} |
trmontgomery | 0:daf9e2f8e1a1 | 199 | }, |
trmontgomery | 0:daf9e2f8e1a1 | 200 | { |
trmontgomery | 0:daf9e2f8e1a1 | 201 | {BLACK, BLACK, BLACK, LGREN, LGREN, LGREN, BLACK, BLACK, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 202 | {BLACK, LGREN, LGREN, LGREN, LGREN, LGREN, LGREN, LGREN, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 203 | {BLACK, LGREN, BLACK, WHITE, LGREN, BLACK, WHITE, LGREN, BLACK}, |
trmontgomery | 0:daf9e2f8e1a1 | 204 | {BLACK, LGREN, WHITE, WHITE, LGREN, WHITE, WHITE, LGREN, LGREN}, |
trmontgomery | 0:daf9e2f8e1a1 | 205 | {BLACK, LGREN, LGREN, LGREN, LGREN, LGREN, LGREN, LGREN, LGREN}, |
trmontgomery | 0:daf9e2f8e1a1 | 206 | {LGREN, LGREN, LGREN, LGREN, LGREN, LGREN, LGREN, LGREN, LGREN}, |
trmontgomery | 0:daf9e2f8e1a1 | 207 | {LGREN, LGREN, LGREN, LGREN, LGREN, LGREN, LGREN, LGREN, LGREN}, |
trmontgomery | 0:daf9e2f8e1a1 | 208 | {LGREN, LGREN, LGREN, LGREN, LGREN, LGREN, LGREN, LGREN, LGREN}, |
trmontgomery | 0:daf9e2f8e1a1 | 209 | {LGREN, BLACK, BLACK, BLACK, LGREN, BLACK, BLACK, BLACK, LGREN} |
trmontgomery | 0:daf9e2f8e1a1 | 210 | }, |
trmontgomery | 0:daf9e2f8e1a1 | 211 | |
trmontgomery | 0:daf9e2f8e1a1 | 212 | }; |
trmontgomery | 0:daf9e2f8e1a1 | 213 | #define MAZE_NUM_ROW 40 |
trmontgomery | 0:daf9e2f8e1a1 | 214 | #define MAZE_NUM_COL 42 |
trmontgomery | 0:daf9e2f8e1a1 | 215 | #define MAZE_SCALE 3 |
trmontgomery | 0:daf9e2f8e1a1 | 216 | |
trmontgomery | 0:daf9e2f8e1a1 | 217 | #define GAME_PAUSED 0 |
trmontgomery | 0:daf9e2f8e1a1 | 218 | #define GAME_RUNNING 1 |
trmontgomery | 0:daf9e2f8e1a1 | 219 | #define GAME_OVER 2 |
trmontgomery | 0:daf9e2f8e1a1 | 220 | #define NUM_GHOSTS 4 |
trmontgomery | 0:daf9e2f8e1a1 | 221 | #define NUM_ALL_SPRITES (NUM_GHOSTS + 1) |
trmontgomery | 0:daf9e2f8e1a1 | 222 | |
trmontgomery | 0:daf9e2f8e1a1 | 223 | |
trmontgomery | 0:daf9e2f8e1a1 | 224 | #define BLUE_SQUARE 1 |
trmontgomery | 0:daf9e2f8e1a1 | 225 | #define HONEYDROP_SQUARE 2 |
trmontgomery | 0:daf9e2f8e1a1 | 226 | #define PWRUP_SQUARE 3 |
trmontgomery | 0:daf9e2f8e1a1 | 227 | #define GHOST_ICON 4 |
trmontgomery | 0:daf9e2f8e1a1 | 228 | #define BUZZY_ICON 5 |
trmontgomery | 0:daf9e2f8e1a1 | 229 | #define TRAP_LINE 6 |
trmontgomery | 0:daf9e2f8e1a1 | 230 | |
trmontgomery | 0:daf9e2f8e1a1 | 231 | /////////////////////////////// |
trmontgomery | 0:daf9e2f8e1a1 | 232 | /////////////////////////////// |
trmontgomery | 0:daf9e2f8e1a1 | 233 | // Maze |
trmontgomery | 0:daf9e2f8e1a1 | 234 | // The maze is a scaled down version of the LCD display |
trmontgomery | 0:daf9e2f8e1a1 | 235 | // Each element in the maze is really a 3x3 segment of the LCD |
trmontgomery | 0:daf9e2f8e1a1 | 236 | // This must be taken into account when drawing the maze |
trmontgomery | 0:daf9e2f8e1a1 | 237 | const char gCnstMaze[MAZE_NUM_ROW][MAZE_NUM_COL] = |
trmontgomery | 0:daf9e2f8e1a1 | 238 | { |
trmontgomery | 0:daf9e2f8e1a1 | 239 | 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, |
trmontgomery | 0:daf9e2f8e1a1 | 240 | 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1, |
trmontgomery | 0:daf9e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| 0:daf9e2f8e1a1 | 277 | 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1, |
trmontgomery | 0:daf9e2f8e1a1 | 278 | 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 |
trmontgomery | 0:daf9e2f8e1a1 | 279 | }; |
trmontgomery | 0:daf9e2f8e1a1 | 280 | |
trmontgomery | 0:daf9e2f8e1a1 | 281 |