Class containing all the bitmaps used to make up the various animations used within the game.
Animations.cpp@1:bf0f64c26a0a, 2017-05-04 (annotated)
- Committer:
- el15mh
- Date:
- Thu May 04 14:02:17 2017 +0000
- Revision:
- 1:bf0f64c26a0a
- Parent:
- 0:45606d84dad8
Doxygen commenting added
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
el15mh | 0:45606d84dad8 | 1 | #include "Animations.h" |
el15mh | 0:45606d84dad8 | 2 | |
el15mh | 1:bf0f64c26a0a | 3 | /** |
el15mh | 1:bf0f64c26a0a | 4 | * @details - constructor |
el15mh | 1:bf0f64c26a0a | 5 | */ |
el15mh | 0:45606d84dad8 | 6 | Animations::Animations() |
el15mh | 0:45606d84dad8 | 7 | { |
el15mh | 0:45606d84dad8 | 8 | |
el15mh | 0:45606d84dad8 | 9 | } |
el15mh | 0:45606d84dad8 | 10 | |
el15mh | 1:bf0f64c26a0a | 11 | /** |
el15mh | 1:bf0f64c26a0a | 12 | * @details - destructor |
el15mh | 1:bf0f64c26a0a | 13 | */ |
el15mh | 0:45606d84dad8 | 14 | Animations::~Animations() |
el15mh | 0:45606d84dad8 | 15 | { |
el15mh | 0:45606d84dad8 | 16 | |
el15mh | 0:45606d84dad8 | 17 | } |
el15mh | 0:45606d84dad8 | 18 | |
el15mh | 1:bf0f64c26a0a | 19 | /** |
el15mh | 1:bf0f64c26a0a | 20 | * @details - Function to draw transparent-filled ball rolling across the screen. |
el15mh | 1:bf0f64c26a0a | 21 | */ |
el15mh | 0:45606d84dad8 | 22 | void Animations::rollingEmptyBall(N5110 &lcd) |
el15mh | 0:45606d84dad8 | 23 | { |
el15mh | 0:45606d84dad8 | 24 | // shows ball rolling across the screen |
el15mh | 0:45606d84dad8 | 25 | for (int i = 0; i < 100; i++){ |
el15mh | 0:45606d84dad8 | 26 | |
el15mh | 0:45606d84dad8 | 27 | lcd.clear(); |
el15mh | 0:45606d84dad8 | 28 | lcd.printString(" OUTLINE ", 0, 1); |
el15mh | 0:45606d84dad8 | 29 | lcd.drawCircle(i, 32, 8, FILL_TRANSPARENT); |
el15mh | 0:45606d84dad8 | 30 | lcd.refresh(); |
el15mh | 0:45606d84dad8 | 31 | wait_ms(40); |
el15mh | 0:45606d84dad8 | 32 | |
el15mh | 0:45606d84dad8 | 33 | } |
el15mh | 0:45606d84dad8 | 34 | } |
el15mh | 0:45606d84dad8 | 35 | |
el15mh | 1:bf0f64c26a0a | 36 | /** |
el15mh | 1:bf0f64c26a0a | 37 | * @details - Function to draw solid-filled ball rolling across the screen. |
el15mh | 1:bf0f64c26a0a | 38 | */ |
el15mh | 0:45606d84dad8 | 39 | void Animations::rollingSolidBall(N5110 &lcd) |
el15mh | 0:45606d84dad8 | 40 | { |
el15mh | 0:45606d84dad8 | 41 | // shows ball rolling across the screen |
el15mh | 0:45606d84dad8 | 42 | for (int i = 0; i < 100; i++){ |
el15mh | 0:45606d84dad8 | 43 | |
el15mh | 0:45606d84dad8 | 44 | lcd.clear(); |
el15mh | 0:45606d84dad8 | 45 | lcd.printString(" SOLID ", 0, 1); |
el15mh | 0:45606d84dad8 | 46 | lcd.drawCircle(i, 32, 8, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 47 | lcd.refresh(); |
el15mh | 0:45606d84dad8 | 48 | wait_ms(40); |
el15mh | 0:45606d84dad8 | 49 | } |
el15mh | 0:45606d84dad8 | 50 | |
el15mh | 0:45606d84dad8 | 51 | } |
el15mh | 0:45606d84dad8 | 52 | |
el15mh | 1:bf0f64c26a0a | 53 | /** |
el15mh | 1:bf0f64c26a0a | 54 | * @details - Short intro animation to be used during the loading of the game. |
el15mh | 1:bf0f64c26a0a | 55 | */ |
el15mh | 0:45606d84dad8 | 56 | void Animations::intro(N5110 &lcd, Gamepad &pad) |
el15mh | 0:45606d84dad8 | 57 | { |
el15mh | 0:45606d84dad8 | 58 | // animation sequence |
el15mh | 0:45606d84dad8 | 59 | // lcd.drawCircle(x, y, radius, type); |
el15mh | 0:45606d84dad8 | 60 | |
el15mh | 0:45606d84dad8 | 61 | // DRAW FIRST SEQUENCE OF CIRLCES MOVING ACROSS LCD // |
el15mh | 0:45606d84dad8 | 62 | for (int i = 0; i < 61; i++){ |
el15mh | 0:45606d84dad8 | 63 | |
el15mh | 0:45606d84dad8 | 64 | lcd.clear(); |
el15mh | 0:45606d84dad8 | 65 | lcd.printString(" Welcome to ", 0, 1); |
el15mh | 0:45606d84dad8 | 66 | lcd.printString(" Roller Maze ", 0, 2); |
el15mh | 0:45606d84dad8 | 67 | // printf("loop \n"); |
el15mh | 0:45606d84dad8 | 68 | lcd.drawLine(56, 40, 68, 40, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 69 | lcd.drawLine(56, 41, 68, 41, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 70 | lcd.refresh(); |
el15mh | 0:45606d84dad8 | 71 | |
el15mh | 0:45606d84dad8 | 72 | if (i < 57){ |
el15mh | 0:45606d84dad8 | 73 | lcd.drawCircle(i, 36, 4, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 74 | lcd.refresh(); |
el15mh | 0:45606d84dad8 | 75 | wait_ms(50); |
el15mh | 0:45606d84dad8 | 76 | |
el15mh | 0:45606d84dad8 | 77 | } |
el15mh | 0:45606d84dad8 | 78 | |
el15mh | 0:45606d84dad8 | 79 | else if (i == 57){ |
el15mh | 0:45606d84dad8 | 80 | |
el15mh | 0:45606d84dad8 | 81 | lcd.clear(); |
el15mh | 0:45606d84dad8 | 82 | lcd.printString(" Welcome to ", 0, 1); |
el15mh | 0:45606d84dad8 | 83 | lcd.printString(" Roller Maze ", 0, 2); |
el15mh | 0:45606d84dad8 | 84 | // printf("loop \n"); |
el15mh | 0:45606d84dad8 | 85 | lcd.drawLine(56, 40, 68, 40, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 86 | lcd.drawLine(56, 41, 68, 41, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 87 | lcd.drawCircle(i, 37, 4, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 88 | |
el15mh | 0:45606d84dad8 | 89 | wait_ms(25); |
el15mh | 0:45606d84dad8 | 90 | |
el15mh | 0:45606d84dad8 | 91 | for (int c = 55; c < 68; c++){ |
el15mh | 0:45606d84dad8 | 92 | for (int d = 42; d < 47; d++){ |
el15mh | 0:45606d84dad8 | 93 | |
el15mh | 0:45606d84dad8 | 94 | lcd.clearPixel(c, 42); |
el15mh | 0:45606d84dad8 | 95 | lcd.clearPixel(c, 43); |
el15mh | 0:45606d84dad8 | 96 | lcd.clearPixel(c, 44); |
el15mh | 0:45606d84dad8 | 97 | lcd.clearPixel(c, 45); |
el15mh | 0:45606d84dad8 | 98 | lcd.clearPixel(c, 46); |
el15mh | 0:45606d84dad8 | 99 | lcd.clearPixel(c, 47); |
el15mh | 0:45606d84dad8 | 100 | lcd.refresh(); |
el15mh | 0:45606d84dad8 | 101 | |
el15mh | 0:45606d84dad8 | 102 | } |
el15mh | 0:45606d84dad8 | 103 | } |
el15mh | 0:45606d84dad8 | 104 | |
el15mh | 0:45606d84dad8 | 105 | lcd.refresh(); |
el15mh | 0:45606d84dad8 | 106 | } |
el15mh | 0:45606d84dad8 | 107 | else if (i == 58){ |
el15mh | 0:45606d84dad8 | 108 | |
el15mh | 0:45606d84dad8 | 109 | lcd.clear(); |
el15mh | 0:45606d84dad8 | 110 | lcd.printString(" Welcome to ", 0, 1); |
el15mh | 0:45606d84dad8 | 111 | lcd.printString(" Roller Maze ", 0, 2); |
el15mh | 0:45606d84dad8 | 112 | // printf("loop \n"); |
el15mh | 0:45606d84dad8 | 113 | lcd.drawLine(56, 40, 68, 40, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 114 | lcd.drawLine(56, 41, 68, 41, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 115 | lcd.drawCircle(i, 38, 4, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 116 | |
el15mh | 0:45606d84dad8 | 117 | wait_ms(25); |
el15mh | 0:45606d84dad8 | 118 | |
el15mh | 0:45606d84dad8 | 119 | for (int c = 55; c < 68; c++){ |
el15mh | 0:45606d84dad8 | 120 | for (int d = 42; d < 47; d++){ |
el15mh | 0:45606d84dad8 | 121 | |
el15mh | 0:45606d84dad8 | 122 | lcd.clearPixel(c, 42); |
el15mh | 0:45606d84dad8 | 123 | lcd.clearPixel(c, 43); |
el15mh | 0:45606d84dad8 | 124 | lcd.clearPixel(c, 44); |
el15mh | 0:45606d84dad8 | 125 | lcd.clearPixel(c, 45); |
el15mh | 0:45606d84dad8 | 126 | lcd.clearPixel(c, 46); |
el15mh | 0:45606d84dad8 | 127 | lcd.clearPixel(c, 47); |
el15mh | 0:45606d84dad8 | 128 | lcd.refresh(); |
el15mh | 0:45606d84dad8 | 129 | |
el15mh | 0:45606d84dad8 | 130 | } |
el15mh | 0:45606d84dad8 | 131 | } |
el15mh | 0:45606d84dad8 | 132 | |
el15mh | 0:45606d84dad8 | 133 | lcd.refresh(); |
el15mh | 0:45606d84dad8 | 134 | |
el15mh | 0:45606d84dad8 | 135 | } |
el15mh | 0:45606d84dad8 | 136 | else if (i == 59){ |
el15mh | 0:45606d84dad8 | 137 | |
el15mh | 0:45606d84dad8 | 138 | lcd.clear(); |
el15mh | 0:45606d84dad8 | 139 | lcd.printString(" Welcome to ", 0, 1); |
el15mh | 0:45606d84dad8 | 140 | lcd.printString(" Roller Maze ", 0, 2); |
el15mh | 0:45606d84dad8 | 141 | // printf("loop \n"); |
el15mh | 0:45606d84dad8 | 142 | lcd.drawLine(56, 40, 68, 40, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 143 | lcd.drawLine(56, 41, 68, 41, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 144 | lcd.drawCircle(i, 39, 4, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 145 | |
el15mh | 0:45606d84dad8 | 146 | wait_ms(25); |
el15mh | 0:45606d84dad8 | 147 | |
el15mh | 0:45606d84dad8 | 148 | for (int c = 55; c < 68; c++){ |
el15mh | 0:45606d84dad8 | 149 | for (int d = 42; d < 47; d++){ |
el15mh | 0:45606d84dad8 | 150 | |
el15mh | 0:45606d84dad8 | 151 | lcd.clearPixel(c, 42); |
el15mh | 0:45606d84dad8 | 152 | lcd.clearPixel(c, 43); |
el15mh | 0:45606d84dad8 | 153 | lcd.clearPixel(c, 44); |
el15mh | 0:45606d84dad8 | 154 | lcd.clearPixel(c, 45); |
el15mh | 0:45606d84dad8 | 155 | lcd.clearPixel(c, 46); |
el15mh | 0:45606d84dad8 | 156 | lcd.clearPixel(c, 47); |
el15mh | 0:45606d84dad8 | 157 | lcd.refresh(); |
el15mh | 0:45606d84dad8 | 158 | |
el15mh | 0:45606d84dad8 | 159 | } |
el15mh | 0:45606d84dad8 | 160 | } |
el15mh | 0:45606d84dad8 | 161 | |
el15mh | 0:45606d84dad8 | 162 | lcd.refresh(); |
el15mh | 0:45606d84dad8 | 163 | |
el15mh | 0:45606d84dad8 | 164 | } |
el15mh | 0:45606d84dad8 | 165 | else { |
el15mh | 0:45606d84dad8 | 166 | |
el15mh | 0:45606d84dad8 | 167 | for (int j = 40; j < 48; j++){ |
el15mh | 0:45606d84dad8 | 168 | |
el15mh | 0:45606d84dad8 | 169 | lcd.clear(); |
el15mh | 0:45606d84dad8 | 170 | lcd.printString(" Welcome to ", 0, 1); |
el15mh | 0:45606d84dad8 | 171 | lcd.printString(" Roller Maze ", 0, 2); |
el15mh | 0:45606d84dad8 | 172 | // printf("loop \n"); |
el15mh | 0:45606d84dad8 | 173 | lcd.drawLine(56, 40, 68, 40, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 174 | lcd.drawLine(56, 41, 68, 41, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 175 | lcd.drawCircle(i, j, 4, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 176 | |
el15mh | 0:45606d84dad8 | 177 | wait_ms(12); |
el15mh | 0:45606d84dad8 | 178 | |
el15mh | 0:45606d84dad8 | 179 | for (int c = 55; c < 68; c++){ |
el15mh | 0:45606d84dad8 | 180 | for (int d = 42; d < 47; d++){ |
el15mh | 0:45606d84dad8 | 181 | |
el15mh | 0:45606d84dad8 | 182 | lcd.clearPixel(c, 42); |
el15mh | 0:45606d84dad8 | 183 | lcd.clearPixel(c, 43); |
el15mh | 0:45606d84dad8 | 184 | lcd.clearPixel(c, 44); |
el15mh | 0:45606d84dad8 | 185 | lcd.clearPixel(c, 45); |
el15mh | 0:45606d84dad8 | 186 | lcd.clearPixel(c, 46); |
el15mh | 0:45606d84dad8 | 187 | lcd.clearPixel(c, 47); |
el15mh | 0:45606d84dad8 | 188 | } |
el15mh | 0:45606d84dad8 | 189 | } |
el15mh | 0:45606d84dad8 | 190 | |
el15mh | 0:45606d84dad8 | 191 | } |
el15mh | 0:45606d84dad8 | 192 | |
el15mh | 0:45606d84dad8 | 193 | lcd.refresh(); |
el15mh | 0:45606d84dad8 | 194 | } |
el15mh | 0:45606d84dad8 | 195 | |
el15mh | 0:45606d84dad8 | 196 | // printf("%i \n", i); |
el15mh | 0:45606d84dad8 | 197 | } |
el15mh | 0:45606d84dad8 | 198 | } |
el15mh | 0:45606d84dad8 | 199 | |
el15mh | 1:bf0f64c26a0a | 200 | /** |
el15mh | 1:bf0f64c26a0a | 201 | * @details - Function to display a switch. |
el15mh | 1:bf0f64c26a0a | 202 | */ |
el15mh | 0:45606d84dad8 | 203 | void Animations::soundSwitch(N5110 &lcd, Gamepad &pad, bool tone) |
el15mh | 0:45606d84dad8 | 204 | { |
el15mh | 0:45606d84dad8 | 205 | int exit = 0; |
el15mh | 0:45606d84dad8 | 206 | bool _tone = tone; |
el15mh | 0:45606d84dad8 | 207 | |
el15mh | 0:45606d84dad8 | 208 | while(exit == 0) { |
el15mh | 0:45606d84dad8 | 209 | |
el15mh | 0:45606d84dad8 | 210 | lcd.clear(); |
el15mh | 0:45606d84dad8 | 211 | // draw casing rectangle |
el15mh | 0:45606d84dad8 | 212 | lcd.drawRect(33, 27, 17, 9, FILL_TRANSPARENT); |
el15mh | 0:45606d84dad8 | 213 | |
el15mh | 0:45606d84dad8 | 214 | lcd.printString("Sound Settings", 0, 0); |
el15mh | 0:45606d84dad8 | 215 | lcd.printString(" ON OFF ", 0, 2); |
el15mh | 0:45606d84dad8 | 216 | |
el15mh | 0:45606d84dad8 | 217 | // casing rectangle is filled in one side |
el15mh | 0:45606d84dad8 | 218 | // depending on value of _tone |
el15mh | 0:45606d84dad8 | 219 | if (_tone){ |
el15mh | 0:45606d84dad8 | 220 | lcd.drawRect(34, 28, 7, 7, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 221 | } |
el15mh | 0:45606d84dad8 | 222 | else { |
el15mh | 0:45606d84dad8 | 223 | lcd.drawRect(42, 28, 7, 7, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 224 | } |
el15mh | 0:45606d84dad8 | 225 | |
el15mh | 0:45606d84dad8 | 226 | lcd.refresh(); |
el15mh | 0:45606d84dad8 | 227 | |
el15mh | 0:45606d84dad8 | 228 | wait_ms(10); |
el15mh | 0:45606d84dad8 | 229 | |
el15mh | 0:45606d84dad8 | 230 | if (pad.check_event(Gamepad::BACK_PRESSED)){ |
el15mh | 0:45606d84dad8 | 231 | |
el15mh | 0:45606d84dad8 | 232 | return; |
el15mh | 0:45606d84dad8 | 233 | } |
el15mh | 0:45606d84dad8 | 234 | } |
el15mh | 0:45606d84dad8 | 235 | } |
el15mh | 0:45606d84dad8 | 236 | |
el15mh | 1:bf0f64c26a0a | 237 | /** |
el15mh | 1:bf0f64c26a0a | 238 | * @details - Function to draw vertical joystick image. |
el15mh | 1:bf0f64c26a0a | 239 | */ |
el15mh | 0:45606d84dad8 | 240 | void Animations::drawVerticalJoystick(N5110 &lcd) |
el15mh | 0:45606d84dad8 | 241 | { |
el15mh | 0:45606d84dad8 | 242 | for (int i = 33; i < 57; i++){ |
el15mh | 0:45606d84dad8 | 243 | for (int j = 42; j < 45; j++){ |
el15mh | 0:45606d84dad8 | 244 | lcd.setPixel(i, j); |
el15mh | 0:45606d84dad8 | 245 | } |
el15mh | 0:45606d84dad8 | 246 | } |
el15mh | 0:45606d84dad8 | 247 | |
el15mh | 0:45606d84dad8 | 248 | for (int i = 34; i < 56; i++){ |
el15mh | 0:45606d84dad8 | 249 | for (int j = 40; j < 42; j++){ |
el15mh | 0:45606d84dad8 | 250 | lcd.setPixel(i, j); |
el15mh | 0:45606d84dad8 | 251 | } |
el15mh | 0:45606d84dad8 | 252 | } |
el15mh | 0:45606d84dad8 | 253 | |
el15mh | 0:45606d84dad8 | 254 | for (int i = 35; i < 55; i++){ |
el15mh | 0:45606d84dad8 | 255 | for (int j = 38; j < 40; j++){ |
el15mh | 0:45606d84dad8 | 256 | lcd.setPixel(i, j); |
el15mh | 0:45606d84dad8 | 257 | } |
el15mh | 0:45606d84dad8 | 258 | } |
el15mh | 0:45606d84dad8 | 259 | |
el15mh | 0:45606d84dad8 | 260 | for (int i = 36; i < 54; i++){ |
el15mh | 0:45606d84dad8 | 261 | lcd.setPixel(i, 37); |
el15mh | 0:45606d84dad8 | 262 | } |
el15mh | 0:45606d84dad8 | 263 | |
el15mh | 0:45606d84dad8 | 264 | for (int i = 37; i < 53; i++){ |
el15mh | 0:45606d84dad8 | 265 | lcd.setPixel(i, 36); |
el15mh | 0:45606d84dad8 | 266 | } |
el15mh | 0:45606d84dad8 | 267 | |
el15mh | 0:45606d84dad8 | 268 | for (int i = 39; i < 51; i++){ |
el15mh | 0:45606d84dad8 | 269 | lcd.setPixel(i, 35); |
el15mh | 0:45606d84dad8 | 270 | } |
el15mh | 0:45606d84dad8 | 271 | |
el15mh | 0:45606d84dad8 | 272 | for (int i = 41; i < 49; i++){ |
el15mh | 0:45606d84dad8 | 273 | lcd.setPixel(i, 34); |
el15mh | 0:45606d84dad8 | 274 | } |
el15mh | 0:45606d84dad8 | 275 | |
el15mh | 0:45606d84dad8 | 276 | for (int i = 44; i < 46; i++){ |
el15mh | 0:45606d84dad8 | 277 | for (int j = 31; j < 34; j++){ |
el15mh | 0:45606d84dad8 | 278 | lcd.setPixel(i, j); |
el15mh | 0:45606d84dad8 | 279 | } |
el15mh | 0:45606d84dad8 | 280 | } |
el15mh | 0:45606d84dad8 | 281 | |
el15mh | 0:45606d84dad8 | 282 | for (int i = 37; i < 53; i++){ |
el15mh | 0:45606d84dad8 | 283 | for (int j = 29; j < 31; j++){ |
el15mh | 0:45606d84dad8 | 284 | lcd.setPixel(i, j); |
el15mh | 0:45606d84dad8 | 285 | } |
el15mh | 0:45606d84dad8 | 286 | } |
el15mh | 0:45606d84dad8 | 287 | |
el15mh | 0:45606d84dad8 | 288 | for (int i = 38; i < 52; i++){ |
el15mh | 0:45606d84dad8 | 289 | lcd.setPixel(i, 28); |
el15mh | 0:45606d84dad8 | 290 | } |
el15mh | 0:45606d84dad8 | 291 | |
el15mh | 0:45606d84dad8 | 292 | for (int i = 40; i < 50; i++){ |
el15mh | 0:45606d84dad8 | 293 | lcd.setPixel(i, 27); |
el15mh | 0:45606d84dad8 | 294 | } |
el15mh | 0:45606d84dad8 | 295 | |
el15mh | 0:45606d84dad8 | 296 | for (int i = 42; i < 48; i++){ |
el15mh | 0:45606d84dad8 | 297 | lcd.setPixel(i, 26); |
el15mh | 0:45606d84dad8 | 298 | } |
el15mh | 0:45606d84dad8 | 299 | } |
el15mh | 0:45606d84dad8 | 300 | |
el15mh | 1:bf0f64c26a0a | 301 | /** |
el15mh | 1:bf0f64c26a0a | 302 | * @details - Function to draw joystick image tilting to the left. |
el15mh | 1:bf0f64c26a0a | 303 | */ |
el15mh | 0:45606d84dad8 | 304 | void Animations::drawLeftJoystick(N5110 &lcd) |
el15mh | 0:45606d84dad8 | 305 | { |
el15mh | 0:45606d84dad8 | 306 | for (int i = 33; i < 57; i++){ |
el15mh | 0:45606d84dad8 | 307 | for (int j = 42; j < 45; j++){ |
el15mh | 0:45606d84dad8 | 308 | lcd.setPixel(i, j); |
el15mh | 0:45606d84dad8 | 309 | } |
el15mh | 0:45606d84dad8 | 310 | } |
el15mh | 0:45606d84dad8 | 311 | |
el15mh | 0:45606d84dad8 | 312 | for (int i = 34; i < 56; i++){ |
el15mh | 0:45606d84dad8 | 313 | for (int j = 40; j < 42; j++){ |
el15mh | 0:45606d84dad8 | 314 | lcd.setPixel(i, j); |
el15mh | 0:45606d84dad8 | 315 | } |
el15mh | 0:45606d84dad8 | 316 | } |
el15mh | 0:45606d84dad8 | 317 | |
el15mh | 0:45606d84dad8 | 318 | for (int i = 35; i < 55; i++){ |
el15mh | 0:45606d84dad8 | 319 | for (int j = 38; j < 40; j++){ |
el15mh | 0:45606d84dad8 | 320 | lcd.setPixel(i, j); |
el15mh | 0:45606d84dad8 | 321 | } |
el15mh | 0:45606d84dad8 | 322 | } |
el15mh | 0:45606d84dad8 | 323 | |
el15mh | 0:45606d84dad8 | 324 | for (int i = 36; i < 54; i++){ |
el15mh | 0:45606d84dad8 | 325 | lcd.setPixel(i, 37); |
el15mh | 0:45606d84dad8 | 326 | } |
el15mh | 0:45606d84dad8 | 327 | |
el15mh | 0:45606d84dad8 | 328 | for (int i = 37; i < 53; i++){ |
el15mh | 0:45606d84dad8 | 329 | lcd.setPixel(i, 36); |
el15mh | 0:45606d84dad8 | 330 | } |
el15mh | 0:45606d84dad8 | 331 | |
el15mh | 0:45606d84dad8 | 332 | for (int i = 39; i < 51; i++){ |
el15mh | 0:45606d84dad8 | 333 | lcd.setPixel(i, 35); |
el15mh | 0:45606d84dad8 | 334 | } |
el15mh | 0:45606d84dad8 | 335 | |
el15mh | 0:45606d84dad8 | 336 | for (int i = 39; i < 49; i++){ |
el15mh | 0:45606d84dad8 | 337 | lcd.setPixel(i, 34); |
el15mh | 0:45606d84dad8 | 338 | } |
el15mh | 0:45606d84dad8 | 339 | |
el15mh | 0:45606d84dad8 | 340 | for (int i = 38; i < 41; i++){ |
el15mh | 0:45606d84dad8 | 341 | lcd.setPixel(i, 33); |
el15mh | 0:45606d84dad8 | 342 | } |
el15mh | 0:45606d84dad8 | 343 | |
el15mh | 0:45606d84dad8 | 344 | for (int i = 37; i < 40; i++){ |
el15mh | 0:45606d84dad8 | 345 | lcd.setPixel(i, 32); |
el15mh | 0:45606d84dad8 | 346 | } |
el15mh | 0:45606d84dad8 | 347 | |
el15mh | 0:45606d84dad8 | 348 | for (int i = 33; i < 39; i++){ |
el15mh | 0:45606d84dad8 | 349 | lcd.setPixel(i, 31); |
el15mh | 0:45606d84dad8 | 350 | } |
el15mh | 0:45606d84dad8 | 351 | |
el15mh | 0:45606d84dad8 | 352 | for (int j = 32; j < 36; j++){ |
el15mh | 0:45606d84dad8 | 353 | lcd.setPixel(31, j); |
el15mh | 0:45606d84dad8 | 354 | } |
el15mh | 0:45606d84dad8 | 355 | |
el15mh | 0:45606d84dad8 | 356 | for (int j = 29; j < 35; j++){ |
el15mh | 0:45606d84dad8 | 357 | lcd.setPixel(32, j); |
el15mh | 0:45606d84dad8 | 358 | } |
el15mh | 0:45606d84dad8 | 359 | |
el15mh | 0:45606d84dad8 | 360 | for (int j = 28; j < 34; j++){ |
el15mh | 0:45606d84dad8 | 361 | lcd.setPixel(33, j); |
el15mh | 0:45606d84dad8 | 362 | } |
el15mh | 0:45606d84dad8 | 363 | |
el15mh | 0:45606d84dad8 | 364 | for (int j = 27; j < 33; j++){ |
el15mh | 0:45606d84dad8 | 365 | lcd.setPixel(34, j); |
el15mh | 0:45606d84dad8 | 366 | } |
el15mh | 0:45606d84dad8 | 367 | |
el15mh | 0:45606d84dad8 | 368 | for (int j = 26; j < 32; j++){ |
el15mh | 0:45606d84dad8 | 369 | lcd.setPixel(35, j); |
el15mh | 0:45606d84dad8 | 370 | } |
el15mh | 0:45606d84dad8 | 371 | |
el15mh | 0:45606d84dad8 | 372 | for (int j = 26; j < 31; j++){ |
el15mh | 0:45606d84dad8 | 373 | lcd.setPixel(36, j); |
el15mh | 0:45606d84dad8 | 374 | lcd.setPixel(37, j); |
el15mh | 0:45606d84dad8 | 375 | } |
el15mh | 0:45606d84dad8 | 376 | |
el15mh | 0:45606d84dad8 | 377 | for (int j = 25; j < 29; j++){ |
el15mh | 0:45606d84dad8 | 378 | lcd.setPixel(38, j); |
el15mh | 0:45606d84dad8 | 379 | } |
el15mh | 0:45606d84dad8 | 380 | |
el15mh | 0:45606d84dad8 | 381 | for (int j = 25; j < 28; j++){ |
el15mh | 0:45606d84dad8 | 382 | lcd.setPixel(39, j); |
el15mh | 0:45606d84dad8 | 383 | } |
el15mh | 0:45606d84dad8 | 384 | |
el15mh | 0:45606d84dad8 | 385 | lcd.setPixel(40, 25); |
el15mh | 0:45606d84dad8 | 386 | lcd.setPixel(40, 26); |
el15mh | 0:45606d84dad8 | 387 | lcd.setPixel(41, 25); |
el15mh | 0:45606d84dad8 | 388 | } |
el15mh | 0:45606d84dad8 | 389 | |
el15mh | 1:bf0f64c26a0a | 390 | /** |
el15mh | 1:bf0f64c26a0a | 391 | * @details - Function to draw joystick image tilting to the right. |
el15mh | 1:bf0f64c26a0a | 392 | */ |
el15mh | 0:45606d84dad8 | 393 | void Animations::drawRightJoystick(N5110 &lcd) |
el15mh | 0:45606d84dad8 | 394 | { |
el15mh | 0:45606d84dad8 | 395 | for (int i = 33; i < 57; i++){ |
el15mh | 0:45606d84dad8 | 396 | for (int j = 42; j < 45; j++){ |
el15mh | 0:45606d84dad8 | 397 | lcd.setPixel(i, j); |
el15mh | 0:45606d84dad8 | 398 | } |
el15mh | 0:45606d84dad8 | 399 | } |
el15mh | 0:45606d84dad8 | 400 | |
el15mh | 0:45606d84dad8 | 401 | for (int i = 34; i < 56; i++){ |
el15mh | 0:45606d84dad8 | 402 | for (int j = 40; j < 42; j++){ |
el15mh | 0:45606d84dad8 | 403 | lcd.setPixel(i, j); |
el15mh | 0:45606d84dad8 | 404 | } |
el15mh | 0:45606d84dad8 | 405 | } |
el15mh | 0:45606d84dad8 | 406 | |
el15mh | 0:45606d84dad8 | 407 | for (int i = 35; i < 55; i++){ |
el15mh | 0:45606d84dad8 | 408 | for (int j = 38; j < 40; j++){ |
el15mh | 0:45606d84dad8 | 409 | lcd.setPixel(i, j); |
el15mh | 0:45606d84dad8 | 410 | } |
el15mh | 0:45606d84dad8 | 411 | } |
el15mh | 0:45606d84dad8 | 412 | |
el15mh | 0:45606d84dad8 | 413 | for (int i = 36; i < 54; i++){ |
el15mh | 0:45606d84dad8 | 414 | lcd.setPixel(i, 37); |
el15mh | 0:45606d84dad8 | 415 | } |
el15mh | 0:45606d84dad8 | 416 | |
el15mh | 0:45606d84dad8 | 417 | for (int i = 37; i < 53; i++){ |
el15mh | 0:45606d84dad8 | 418 | lcd.setPixel(i, 36); |
el15mh | 0:45606d84dad8 | 419 | } |
el15mh | 0:45606d84dad8 | 420 | |
el15mh | 0:45606d84dad8 | 421 | for (int i = 39; i < 51; i++){ |
el15mh | 0:45606d84dad8 | 422 | lcd.setPixel(i, 35); |
el15mh | 0:45606d84dad8 | 423 | } |
el15mh | 0:45606d84dad8 | 424 | |
el15mh | 0:45606d84dad8 | 425 | for (int i = 41; i < 51; i++){ |
el15mh | 0:45606d84dad8 | 426 | lcd.setPixel(i, 34); |
el15mh | 0:45606d84dad8 | 427 | } |
el15mh | 0:45606d84dad8 | 428 | |
el15mh | 0:45606d84dad8 | 429 | for (int i = 49; i < 52; i++){ |
el15mh | 0:45606d84dad8 | 430 | lcd.setPixel(i, 33); |
el15mh | 0:45606d84dad8 | 431 | } |
el15mh | 0:45606d84dad8 | 432 | |
el15mh | 0:45606d84dad8 | 433 | for (int i = 50; i < 53; i++){ |
el15mh | 0:45606d84dad8 | 434 | lcd.setPixel(i, 32); |
el15mh | 0:45606d84dad8 | 435 | } |
el15mh | 0:45606d84dad8 | 436 | |
el15mh | 0:45606d84dad8 | 437 | for (int i = 51; i < 55; i++){ |
el15mh | 0:45606d84dad8 | 438 | lcd.setPixel(i, 31); |
el15mh | 0:45606d84dad8 | 439 | } |
el15mh | 0:45606d84dad8 | 440 | |
el15mh | 0:45606d84dad8 | 441 | for (int j = 32; j < 36; j++){ |
el15mh | 0:45606d84dad8 | 442 | lcd.setPixel(58, j); |
el15mh | 0:45606d84dad8 | 443 | } |
el15mh | 0:45606d84dad8 | 444 | |
el15mh | 0:45606d84dad8 | 445 | for (int j = 29; j < 35; j++){ |
el15mh | 0:45606d84dad8 | 446 | lcd.setPixel(57, j); |
el15mh | 0:45606d84dad8 | 447 | } |
el15mh | 0:45606d84dad8 | 448 | |
el15mh | 0:45606d84dad8 | 449 | for (int j = 28; j < 34; j++){ |
el15mh | 0:45606d84dad8 | 450 | lcd.setPixel(56, j); |
el15mh | 0:45606d84dad8 | 451 | } |
el15mh | 0:45606d84dad8 | 452 | |
el15mh | 0:45606d84dad8 | 453 | for (int j = 27; j < 33; j++){ |
el15mh | 0:45606d84dad8 | 454 | lcd.setPixel(55, j); |
el15mh | 0:45606d84dad8 | 455 | } |
el15mh | 0:45606d84dad8 | 456 | |
el15mh | 0:45606d84dad8 | 457 | for (int i = 52; i < 55; i++){ |
el15mh | 0:45606d84dad8 | 458 | for (int j = 26; j < 31; j++){ |
el15mh | 0:45606d84dad8 | 459 | lcd.setPixel(i, j); |
el15mh | 0:45606d84dad8 | 460 | } |
el15mh | 0:45606d84dad8 | 461 | } |
el15mh | 0:45606d84dad8 | 462 | |
el15mh | 0:45606d84dad8 | 463 | for (int j = 25; j < 29; j++){ |
el15mh | 0:45606d84dad8 | 464 | lcd.setPixel(51, j); |
el15mh | 0:45606d84dad8 | 465 | } |
el15mh | 0:45606d84dad8 | 466 | |
el15mh | 0:45606d84dad8 | 467 | for (int j = 25; j < 28; j++){ |
el15mh | 0:45606d84dad8 | 468 | lcd.setPixel(50, j); |
el15mh | 0:45606d84dad8 | 469 | } |
el15mh | 0:45606d84dad8 | 470 | |
el15mh | 0:45606d84dad8 | 471 | lcd.setPixel(48, 25); |
el15mh | 0:45606d84dad8 | 472 | lcd.setPixel(49, 25); |
el15mh | 0:45606d84dad8 | 473 | lcd.setPixel(49, 26); |
el15mh | 0:45606d84dad8 | 474 | } |
el15mh | 0:45606d84dad8 | 475 | |
el15mh | 1:bf0f64c26a0a | 476 | /** |
el15mh | 1:bf0f64c26a0a | 477 | * @details - Function to draw gamepad image tilting to the left. |
el15mh | 1:bf0f64c26a0a | 478 | */ |
el15mh | 0:45606d84dad8 | 479 | void Animations::drawLeftGamepad(N5110 &lcd) |
el15mh | 0:45606d84dad8 | 480 | { |
el15mh | 0:45606d84dad8 | 481 | for (int i = 33; i < 42; i++){ |
el15mh | 0:45606d84dad8 | 482 | lcd.setPixel(i, 27); |
el15mh | 0:45606d84dad8 | 483 | } |
el15mh | 0:45606d84dad8 | 484 | for (int i = 31; i < 47; i++){ |
el15mh | 0:45606d84dad8 | 485 | for (int j = 28; j < 30; j++){ |
el15mh | 0:45606d84dad8 | 486 | lcd.setPixel(i, j); |
el15mh | 0:45606d84dad8 | 487 | } |
el15mh | 0:45606d84dad8 | 488 | } |
el15mh | 0:45606d84dad8 | 489 | for (int i = 30; i < 53; i++){ |
el15mh | 0:45606d84dad8 | 490 | for (int j = 30; j < 43; j++){ |
el15mh | 0:45606d84dad8 | 491 | lcd.setPixel(i, j); |
el15mh | 0:45606d84dad8 | 492 | } |
el15mh | 0:45606d84dad8 | 493 | } |
el15mh | 0:45606d84dad8 | 494 | lcd.clearPixel(51, 30); |
el15mh | 0:45606d84dad8 | 495 | lcd.clearPixel(52, 30); |
el15mh | 0:45606d84dad8 | 496 | lcd.clearPixel(51, 31); |
el15mh | 0:45606d84dad8 | 497 | lcd.clearPixel(52, 31); |
el15mh | 0:45606d84dad8 | 498 | lcd.clearPixel(52, 32); |
el15mh | 0:45606d84dad8 | 499 | |
el15mh | 0:45606d84dad8 | 500 | for (int i = 35; i < 43; i++){ |
el15mh | 0:45606d84dad8 | 501 | for (int j = 30; j < 33; j++){ |
el15mh | 0:45606d84dad8 | 502 | lcd.clearPixel(i, j); |
el15mh | 0:45606d84dad8 | 503 | } |
el15mh | 0:45606d84dad8 | 504 | } |
el15mh | 0:45606d84dad8 | 505 | |
el15mh | 0:45606d84dad8 | 506 | for (int i = 36; i < 44; i++){ |
el15mh | 0:45606d84dad8 | 507 | for (int j = 33; j < 36; j++){ |
el15mh | 0:45606d84dad8 | 508 | lcd.clearPixel(i, j); |
el15mh | 0:45606d84dad8 | 509 | } |
el15mh | 0:45606d84dad8 | 510 | } |
el15mh | 0:45606d84dad8 | 511 | |
el15mh | 0:45606d84dad8 | 512 | for (int j = 33; j < 40; j++){ |
el15mh | 0:45606d84dad8 | 513 | lcd.setPixel(29, j); |
el15mh | 0:45606d84dad8 | 514 | } |
el15mh | 0:45606d84dad8 | 515 | |
el15mh | 0:45606d84dad8 | 516 | for (int j = 36; j < 42; j++){ |
el15mh | 0:45606d84dad8 | 517 | lcd.setPixel(53, j); |
el15mh | 0:45606d84dad8 | 518 | } |
el15mh | 0:45606d84dad8 | 519 | |
el15mh | 0:45606d84dad8 | 520 | for (int i = 31; i < 39; i++){ |
el15mh | 0:45606d84dad8 | 521 | lcd.setPixel(i, 43); |
el15mh | 0:45606d84dad8 | 522 | } |
el15mh | 0:45606d84dad8 | 523 | |
el15mh | 0:45606d84dad8 | 524 | for (int i = 32; i < 38; i++){ |
el15mh | 0:45606d84dad8 | 525 | lcd.setPixel(i, 44); |
el15mh | 0:45606d84dad8 | 526 | } |
el15mh | 0:45606d84dad8 | 527 | |
el15mh | 0:45606d84dad8 | 528 | for (int i = 33; i < 37; i++){ |
el15mh | 0:45606d84dad8 | 529 | lcd.setPixel(i, 45); |
el15mh | 0:45606d84dad8 | 530 | } |
el15mh | 0:45606d84dad8 | 531 | |
el15mh | 0:45606d84dad8 | 532 | for (int i = 46; i < 53; i++){ |
el15mh | 0:45606d84dad8 | 533 | lcd.setPixel(i, 43); |
el15mh | 0:45606d84dad8 | 534 | lcd.setPixel(i, 44); |
el15mh | 0:45606d84dad8 | 535 | } |
el15mh | 0:45606d84dad8 | 536 | |
el15mh | 0:45606d84dad8 | 537 | lcd.clearPixel(46, 44); |
el15mh | 0:45606d84dad8 | 538 | |
el15mh | 0:45606d84dad8 | 539 | for (int i = 48; i < 52; i++){ |
el15mh | 0:45606d84dad8 | 540 | lcd.setPixel(i, 45); |
el15mh | 0:45606d84dad8 | 541 | } |
el15mh | 0:45606d84dad8 | 542 | |
el15mh | 0:45606d84dad8 | 543 | lcd.clearPixel(31, 45); |
el15mh | 0:45606d84dad8 | 544 | lcd.clearPixel(32, 45); |
el15mh | 0:45606d84dad8 | 545 | } |
el15mh | 0:45606d84dad8 | 546 | |
el15mh | 1:bf0f64c26a0a | 547 | /** |
el15mh | 1:bf0f64c26a0a | 548 | * @details - Function to draw vertical gamepad image. |
el15mh | 1:bf0f64c26a0a | 549 | */ |
el15mh | 0:45606d84dad8 | 550 | void Animations::drawVerticalGamepad(N5110 &lcd) |
el15mh | 0:45606d84dad8 | 551 | { |
el15mh | 0:45606d84dad8 | 552 | for (int i = 38; i < 48; i++){ |
el15mh | 0:45606d84dad8 | 553 | lcd.setPixel(i, 27); |
el15mh | 0:45606d84dad8 | 554 | } |
el15mh | 0:45606d84dad8 | 555 | |
el15mh | 0:45606d84dad8 | 556 | for (int i = 35; i < 51; i++){ |
el15mh | 0:45606d84dad8 | 557 | lcd.setPixel(i, 28); |
el15mh | 0:45606d84dad8 | 558 | } |
el15mh | 0:45606d84dad8 | 559 | |
el15mh | 0:45606d84dad8 | 560 | for (int i = 33; i < 53; i++){ |
el15mh | 0:45606d84dad8 | 561 | for (int j = 29; j < 43; j++){ |
el15mh | 0:45606d84dad8 | 562 | lcd.setPixel(i, j); |
el15mh | 0:45606d84dad8 | 563 | } |
el15mh | 0:45606d84dad8 | 564 | } |
el15mh | 0:45606d84dad8 | 565 | |
el15mh | 0:45606d84dad8 | 566 | for (int i = 39; i < 47; i++){ |
el15mh | 0:45606d84dad8 | 567 | for (int j = 30; j < 36; j++){ |
el15mh | 0:45606d84dad8 | 568 | lcd.clearPixel(i, j); |
el15mh | 0:45606d84dad8 | 569 | } |
el15mh | 0:45606d84dad8 | 570 | } |
el15mh | 0:45606d84dad8 | 571 | |
el15mh | 0:45606d84dad8 | 572 | for (int j = 37; j < 42; j++){ |
el15mh | 0:45606d84dad8 | 573 | lcd.setPixel(30, j); |
el15mh | 0:45606d84dad8 | 574 | lcd.setPixel(55, j); |
el15mh | 0:45606d84dad8 | 575 | } |
el15mh | 0:45606d84dad8 | 576 | |
el15mh | 0:45606d84dad8 | 577 | for (int j = 34; j < 44; j++){ |
el15mh | 0:45606d84dad8 | 578 | lcd.setPixel(31, j); |
el15mh | 0:45606d84dad8 | 579 | lcd.setPixel(54, j); |
el15mh | 0:45606d84dad8 | 580 | } |
el15mh | 0:45606d84dad8 | 581 | |
el15mh | 0:45606d84dad8 | 582 | for (int j = 31; j < 45; j++){ |
el15mh | 0:45606d84dad8 | 583 | lcd.setPixel(32, j); |
el15mh | 0:45606d84dad8 | 584 | lcd.setPixel(53, j); |
el15mh | 0:45606d84dad8 | 585 | } |
el15mh | 0:45606d84dad8 | 586 | |
el15mh | 0:45606d84dad8 | 587 | for (int i = 33; i < 39; i++){ |
el15mh | 0:45606d84dad8 | 588 | lcd.setPixel(i, 43); |
el15mh | 0:45606d84dad8 | 589 | lcd.setPixel(i, 44); |
el15mh | 0:45606d84dad8 | 590 | lcd.setPixel(i, 45); |
el15mh | 0:45606d84dad8 | 591 | } |
el15mh | 0:45606d84dad8 | 592 | |
el15mh | 0:45606d84dad8 | 593 | lcd.clearPixel(38, 44); |
el15mh | 0:45606d84dad8 | 594 | lcd.clearPixel(37, 45); |
el15mh | 0:45606d84dad8 | 595 | lcd.clearPixel(38, 45); |
el15mh | 0:45606d84dad8 | 596 | |
el15mh | 0:45606d84dad8 | 597 | for (int i = 47; i < 53; i++){ |
el15mh | 0:45606d84dad8 | 598 | lcd.setPixel(i, 43); |
el15mh | 0:45606d84dad8 | 599 | lcd.setPixel(i, 44); |
el15mh | 0:45606d84dad8 | 600 | lcd.setPixel(i, 45); |
el15mh | 0:45606d84dad8 | 601 | } |
el15mh | 0:45606d84dad8 | 602 | |
el15mh | 0:45606d84dad8 | 603 | lcd.clearPixel(47, 44); |
el15mh | 0:45606d84dad8 | 604 | lcd.clearPixel(47, 45); |
el15mh | 0:45606d84dad8 | 605 | lcd.clearPixel(48, 45); |
el15mh | 0:45606d84dad8 | 606 | } |
el15mh | 0:45606d84dad8 | 607 | |
el15mh | 1:bf0f64c26a0a | 608 | /** |
el15mh | 1:bf0f64c26a0a | 609 | * @details - Function to draw gamepad image tilting to the right. |
el15mh | 1:bf0f64c26a0a | 610 | */ |
el15mh | 0:45606d84dad8 | 611 | void Animations::drawRightGamepad(N5110 &lcd) |
el15mh | 0:45606d84dad8 | 612 | { |
el15mh | 0:45606d84dad8 | 613 | for (int i = 43; i < 52; i++){ |
el15mh | 0:45606d84dad8 | 614 | lcd.setPixel(i, 27); |
el15mh | 0:45606d84dad8 | 615 | } |
el15mh | 0:45606d84dad8 | 616 | |
el15mh | 0:45606d84dad8 | 617 | for (int i = 38; i < 54; i++){ |
el15mh | 0:45606d84dad8 | 618 | lcd.setPixel(i, 28); |
el15mh | 0:45606d84dad8 | 619 | } |
el15mh | 0:45606d84dad8 | 620 | |
el15mh | 0:45606d84dad8 | 621 | for (int i = 36; i < 54; i++){ |
el15mh | 0:45606d84dad8 | 622 | lcd.setPixel(i, 29); |
el15mh | 0:45606d84dad8 | 623 | } |
el15mh | 0:45606d84dad8 | 624 | |
el15mh | 0:45606d84dad8 | 625 | for (int i = 34; i < 55; i++){ |
el15mh | 0:45606d84dad8 | 626 | for (int j = 30; j < 43; j++){ |
el15mh | 0:45606d84dad8 | 627 | lcd.setPixel(i, j); |
el15mh | 0:45606d84dad8 | 628 | } |
el15mh | 0:45606d84dad8 | 629 | } |
el15mh | 0:45606d84dad8 | 630 | |
el15mh | 0:45606d84dad8 | 631 | for (int i = 42; i < 50; i++){ |
el15mh | 0:45606d84dad8 | 632 | for (int j = 30; j < 33; j++){ |
el15mh | 0:45606d84dad8 | 633 | lcd.clearPixel(i, j); |
el15mh | 0:45606d84dad8 | 634 | } |
el15mh | 0:45606d84dad8 | 635 | } |
el15mh | 0:45606d84dad8 | 636 | |
el15mh | 0:45606d84dad8 | 637 | for (int i = 41; i < 49; i++){ |
el15mh | 0:45606d84dad8 | 638 | for (int j = 33; j < 36; j++){ |
el15mh | 0:45606d84dad8 | 639 | lcd.clearPixel(i, j); |
el15mh | 0:45606d84dad8 | 640 | } |
el15mh | 0:45606d84dad8 | 641 | } |
el15mh | 0:45606d84dad8 | 642 | |
el15mh | 0:45606d84dad8 | 643 | for (int j = 36; j < 42; j++){ |
el15mh | 0:45606d84dad8 | 644 | lcd.setPixel(31, j); |
el15mh | 0:45606d84dad8 | 645 | } |
el15mh | 0:45606d84dad8 | 646 | |
el15mh | 0:45606d84dad8 | 647 | for (int j = 33; j < 45; j++){ |
el15mh | 0:45606d84dad8 | 648 | lcd.setPixel(32, j); |
el15mh | 0:45606d84dad8 | 649 | } |
el15mh | 0:45606d84dad8 | 650 | |
el15mh | 0:45606d84dad8 | 651 | for (int j = 32; j < 46; j++){ |
el15mh | 0:45606d84dad8 | 652 | lcd.setPixel(33, j); |
el15mh | 0:45606d84dad8 | 653 | } |
el15mh | 0:45606d84dad8 | 654 | |
el15mh | 0:45606d84dad8 | 655 | for (int i = 34; i < 39; i++){ |
el15mh | 0:45606d84dad8 | 656 | lcd.setPixel(i, 43); |
el15mh | 0:45606d84dad8 | 657 | lcd.setPixel(i, 44); |
el15mh | 0:45606d84dad8 | 658 | lcd.setPixel(i, 45); |
el15mh | 0:45606d84dad8 | 659 | } |
el15mh | 0:45606d84dad8 | 660 | |
el15mh | 0:45606d84dad8 | 661 | lcd.clearPixel(37, 45); |
el15mh | 0:45606d84dad8 | 662 | lcd.clearPixel(38, 44); |
el15mh | 0:45606d84dad8 | 663 | lcd.clearPixel(38, 45); |
el15mh | 0:45606d84dad8 | 664 | |
el15mh | 0:45606d84dad8 | 665 | for (int i = 46; i < 54; i++){ |
el15mh | 0:45606d84dad8 | 666 | lcd.setPixel(i, 43); |
el15mh | 0:45606d84dad8 | 667 | } |
el15mh | 0:45606d84dad8 | 668 | |
el15mh | 0:45606d84dad8 | 669 | for (int i = 47; i < 53; i++){ |
el15mh | 0:45606d84dad8 | 670 | lcd.setPixel(i, 44); |
el15mh | 0:45606d84dad8 | 671 | } |
el15mh | 0:45606d84dad8 | 672 | |
el15mh | 0:45606d84dad8 | 673 | for (int i = 48; i < 52; i++){ |
el15mh | 0:45606d84dad8 | 674 | lcd.setPixel(i, 45); |
el15mh | 0:45606d84dad8 | 675 | } |
el15mh | 0:45606d84dad8 | 676 | |
el15mh | 0:45606d84dad8 | 677 | for (int j = 33; j < 40; j++){ |
el15mh | 0:45606d84dad8 | 678 | lcd.setPixel(55, j); |
el15mh | 0:45606d84dad8 | 679 | } |
el15mh | 0:45606d84dad8 | 680 | } |
el15mh | 0:45606d84dad8 | 681 | |
el15mh | 1:bf0f64c26a0a | 682 | /** |
el15mh | 1:bf0f64c26a0a | 683 | * @details - Short animation to be used maze is completed. |
el15mh | 1:bf0f64c26a0a | 684 | */ |
el15mh | 0:45606d84dad8 | 685 | void Animations::mazeCompleted(N5110 &lcd) |
el15mh | 0:45606d84dad8 | 686 | { |
el15mh | 0:45606d84dad8 | 687 | lcd.printString(" MAZE", 0, 2); |
el15mh | 0:45606d84dad8 | 688 | lcd.printString(" DONE!", 0, 3); |
el15mh | 0:45606d84dad8 | 689 | } |
el15mh | 0:45606d84dad8 | 690 | |
el15mh | 1:bf0f64c26a0a | 691 | /** |
el15mh | 1:bf0f64c26a0a | 692 | * @details - First animation in a series to create a jumping man. |
el15mh | 1:bf0f64c26a0a | 693 | */ |
el15mh | 0:45606d84dad8 | 694 | void Animations::stickmanOne(N5110 &lcd) |
el15mh | 0:45606d84dad8 | 695 | { |
el15mh | 0:45606d84dad8 | 696 | lcd.clear(); |
el15mh | 0:45606d84dad8 | 697 | mazeCompleted(lcd); |
el15mh | 0:45606d84dad8 | 698 | |
el15mh | 0:45606d84dad8 | 699 | // drawing arms |
el15mh | 0:45606d84dad8 | 700 | lcd.drawLine(53, 26, 53, 27, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 701 | lcd.setPixel(54, 25); |
el15mh | 0:45606d84dad8 | 702 | lcd.setPixel(55, 24); |
el15mh | 0:45606d84dad8 | 703 | lcd.drawLine(55, 23, 56, 23, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 704 | lcd.drawLine(58, 22, 62, 22, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 705 | lcd.setPixel(63, 22); |
el15mh | 0:45606d84dad8 | 706 | lcd.setPixel(64, 22); |
el15mh | 0:45606d84dad8 | 707 | lcd.setPixel(63, 23); |
el15mh | 0:45606d84dad8 | 708 | lcd.setPixel(64, 23); |
el15mh | 0:45606d84dad8 | 709 | lcd.setPixel(65, 24); |
el15mh | 0:45606d84dad8 | 710 | lcd.setPixel(66, 25); |
el15mh | 0:45606d84dad8 | 711 | lcd.drawLine(67, 26, 67, 27, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 712 | |
el15mh | 0:45606d84dad8 | 713 | // drawing head |
el15mh | 0:45606d84dad8 | 714 | lcd.drawCircle(60, 17, 3, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 715 | |
el15mh | 0:45606d84dad8 | 716 | // draw body and legs |
el15mh | 0:45606d84dad8 | 717 | lcd.drawLine(60, 17, 60, 30, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 718 | lcd.drawLine(59, 31, 59, 35, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 719 | lcd.drawLine(61, 31, 61, 35, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 720 | lcd.drawLine(58, 35, 58, 38, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 721 | lcd.drawLine(62, 35, 62, 38, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 722 | lcd.drawLine(57, 39, 57, 41, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 723 | lcd.drawLine(63, 39, 63, 41, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 724 | |
el15mh | 0:45606d84dad8 | 725 | } |
el15mh | 0:45606d84dad8 | 726 | |
el15mh | 1:bf0f64c26a0a | 727 | /** |
el15mh | 1:bf0f64c26a0a | 728 | * @details - Second animation in a series to create a jumping man. |
el15mh | 1:bf0f64c26a0a | 729 | */ |
el15mh | 0:45606d84dad8 | 730 | void Animations::stickmanTwo(N5110 &lcd) |
el15mh | 0:45606d84dad8 | 731 | { |
el15mh | 0:45606d84dad8 | 732 | lcd.clear(); |
el15mh | 0:45606d84dad8 | 733 | mazeCompleted(lcd); |
el15mh | 0:45606d84dad8 | 734 | |
el15mh | 0:45606d84dad8 | 735 | // drawing arms |
el15mh | 0:45606d84dad8 | 736 | lcd.drawLine(53, 25, 56, 22, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 737 | lcd.setPixel(57, 22); |
el15mh | 0:45606d84dad8 | 738 | lcd.drawLine(58, 21, 62, 21, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 739 | lcd.setPixel(63, 22); |
el15mh | 0:45606d84dad8 | 740 | lcd.drawLine(64, 22, 67, 25, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 741 | |
el15mh | 0:45606d84dad8 | 742 | // drawing head |
el15mh | 0:45606d84dad8 | 743 | lcd.drawCircle(60, 16, 3, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 744 | |
el15mh | 0:45606d84dad8 | 745 | // drawing body and legs |
el15mh | 0:45606d84dad8 | 746 | lcd.drawLine(58, 35, 58, 41, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 747 | lcd.drawLine(59, 30, 59, 34, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 748 | lcd.drawLine(60, 16, 60, 29, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 749 | lcd.drawLine(61, 30, 61, 34, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 750 | lcd.drawLine(62, 35, 62, 41, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 751 | |
el15mh | 0:45606d84dad8 | 752 | } |
el15mh | 0:45606d84dad8 | 753 | |
el15mh | 1:bf0f64c26a0a | 754 | /** |
el15mh | 1:bf0f64c26a0a | 755 | * @details - Third animation in a series to create a jumping man. |
el15mh | 1:bf0f64c26a0a | 756 | */ |
el15mh | 0:45606d84dad8 | 757 | void Animations::stickmanThree(N5110 &lcd) |
el15mh | 0:45606d84dad8 | 758 | { |
el15mh | 0:45606d84dad8 | 759 | lcd.clear(); |
el15mh | 0:45606d84dad8 | 760 | mazeCompleted(lcd); |
el15mh | 0:45606d84dad8 | 761 | |
el15mh | 0:45606d84dad8 | 762 | // drawing arms |
el15mh | 0:45606d84dad8 | 763 | lcd.drawLine(52, 23, 57, 20, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 764 | lcd.drawLine(57, 20, 63, 20, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 765 | lcd.drawLine(63, 20, 68, 23, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 766 | |
el15mh | 0:45606d84dad8 | 767 | // drawing head |
el15mh | 0:45606d84dad8 | 768 | lcd.drawCircle(60, 15, 3, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 769 | |
el15mh | 0:45606d84dad8 | 770 | // drawing body and legs |
el15mh | 0:45606d84dad8 | 771 | lcd.drawLine(58, 35, 58, 41, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 772 | lcd.drawLine(59, 29, 59, 34, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 773 | lcd.drawLine(60, 16, 60, 28, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 774 | lcd.drawLine(61, 29, 61, 34, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 775 | lcd.drawLine(62, 35, 62, 41, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 776 | |
el15mh | 0:45606d84dad8 | 777 | } |
el15mh | 0:45606d84dad8 | 778 | |
el15mh | 1:bf0f64c26a0a | 779 | /** |
el15mh | 1:bf0f64c26a0a | 780 | * @details - Fourth animation in a series to create a jumping man. |
el15mh | 1:bf0f64c26a0a | 781 | */ |
el15mh | 0:45606d84dad8 | 782 | void Animations::stickmanFour(N5110 &lcd) |
el15mh | 0:45606d84dad8 | 783 | { |
el15mh | 0:45606d84dad8 | 784 | lcd.clear(); |
el15mh | 0:45606d84dad8 | 785 | mazeCompleted(lcd); |
el15mh | 0:45606d84dad8 | 786 | |
el15mh | 0:45606d84dad8 | 787 | // drawing arms |
el15mh | 0:45606d84dad8 | 788 | lcd.drawLine(52, 20, 53, 20, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 789 | lcd.drawLine(54, 21, 56, 21, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 790 | lcd.drawLine(57, 20, 63, 20, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 791 | lcd.drawLine(64, 21, 66, 21, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 792 | lcd.drawLine(67, 20, 68, 20, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 793 | |
el15mh | 0:45606d84dad8 | 794 | // drawing head |
el15mh | 0:45606d84dad8 | 795 | lcd.drawCircle(60, 15, 3, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 796 | |
el15mh | 0:45606d84dad8 | 797 | // drawing body and legs |
el15mh | 0:45606d84dad8 | 798 | lcd.drawLine(58, 34, 58, 40, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 799 | lcd.drawLine(59, 29, 59, 33, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 800 | lcd.drawLine(60, 16, 60, 28, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 801 | lcd.drawLine(61, 29, 61, 33, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 802 | lcd.drawLine(62, 34, 62, 40, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 803 | |
el15mh | 0:45606d84dad8 | 804 | } |
el15mh | 0:45606d84dad8 | 805 | |
el15mh | 1:bf0f64c26a0a | 806 | /** |
el15mh | 1:bf0f64c26a0a | 807 | * @details - Fifth animation in a series to create a jumping man. |
el15mh | 1:bf0f64c26a0a | 808 | */ |
el15mh | 0:45606d84dad8 | 809 | void Animations::stickmanFive(N5110 &lcd) |
el15mh | 0:45606d84dad8 | 810 | { |
el15mh | 0:45606d84dad8 | 811 | lcd.clear(); |
el15mh | 0:45606d84dad8 | 812 | mazeCompleted(lcd); |
el15mh | 0:45606d84dad8 | 813 | |
el15mh | 0:45606d84dad8 | 814 | // drawing arms |
el15mh | 0:45606d84dad8 | 815 | lcd.drawLine(52, 17, 59, 19, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 816 | lcd.drawLine(61, 19, 68, 17, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 817 | |
el15mh | 0:45606d84dad8 | 818 | // drawing head |
el15mh | 0:45606d84dad8 | 819 | lcd.drawCircle(60, 14, 3, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 820 | |
el15mh | 0:45606d84dad8 | 821 | // drawing body and legs |
el15mh | 0:45606d84dad8 | 822 | lcd.drawLine(58, 33, 58, 39, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 823 | lcd.drawLine(59, 28, 59, 32, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 824 | lcd.drawLine(60, 16, 60, 27, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 825 | lcd.drawLine(61, 28, 61, 32, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 826 | lcd.drawLine(62, 33, 62, 39, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 827 | |
el15mh | 0:45606d84dad8 | 828 | } |
el15mh | 0:45606d84dad8 | 829 | |
el15mh | 1:bf0f64c26a0a | 830 | /** |
el15mh | 1:bf0f64c26a0a | 831 | * @details - Sixth animation in a series to create a jumping man. |
el15mh | 1:bf0f64c26a0a | 832 | */ |
el15mh | 0:45606d84dad8 | 833 | void Animations::stickmanSix(N5110 &lcd) |
el15mh | 0:45606d84dad8 | 834 | { |
el15mh | 0:45606d84dad8 | 835 | lcd.clear(); |
el15mh | 0:45606d84dad8 | 836 | mazeCompleted(lcd); |
el15mh | 0:45606d84dad8 | 837 | |
el15mh | 0:45606d84dad8 | 838 | // drawing arms |
el15mh | 0:45606d84dad8 | 839 | lcd.drawLine(52, 15, 59, 18, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 840 | lcd.drawLine(61, 18, 68, 15, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 841 | |
el15mh | 0:45606d84dad8 | 842 | // drawing head |
el15mh | 0:45606d84dad8 | 843 | lcd.drawCircle(60, 13, 3, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 844 | |
el15mh | 0:45606d84dad8 | 845 | // drawing body and legs |
el15mh | 0:45606d84dad8 | 846 | lcd.drawLine(58, 32, 58, 38, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 847 | lcd.drawLine(59, 27, 59, 31, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 848 | lcd.drawLine(60, 16, 60, 26, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 849 | lcd.drawLine(61, 27, 61, 31, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 850 | lcd.drawLine(62, 32, 62, 38, FILL_BLACK); |
el15mh | 0:45606d84dad8 | 851 | |
el15mh | 0:45606d84dad8 | 852 | } |
el15mh | 0:45606d84dad8 | 853 | |
el15mh | 0:45606d84dad8 | 854 | |
el15mh | 0:45606d84dad8 | 855 | |
el15mh | 0:45606d84dad8 | 856 | |
el15mh | 0:45606d84dad8 | 857 | |
el15mh | 0:45606d84dad8 | 858 | |
el15mh | 0:45606d84dad8 | 859 |