Dependencies:   mbed FATFileSystem

Committer:
rottenegg
Date:
Fri May 10 21:25:27 2019 +0000
Revision:
26:716bcd47f3ca
Parent:
21:f3b0ce18b44f
FINAL_SUBMISSION; ; Changes:; WDplayer: Major Memory Leek fixed related to fclose(); Game_Manager: Tuned Scene Order and Improved Random number generator.; SceneFuctions: Added a Randomly changing Object to Scene 4.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
rottenegg 9:ac396c818874 1 #include "SceneFunctions.h"
rottenegg 10:4fda7b01484a 2 #include "MiscPaths.h"
rottenegg 9:ac396c818874 3
rottenegg 9:ac396c818874 4 //Constructor Functions
rottenegg 9:ac396c818874 5 void SceneFunctions::set_buttonPin(PinName pin) {
rottenegg 9:ac396c818874 6 _BOK = (new DigitalIn(pin));
rottenegg 9:ac396c818874 7 _BOK->mode(PullDown);
rottenegg 10:4fda7b01484a 8 _progress = 0;
rottenegg 10:4fda7b01484a 9 _p[0] = true;
rottenegg 10:4fda7b01484a 10 _p[1] = true;
rottenegg 10:4fda7b01484a 11 _p[2] = true;
rottenegg 21:f3b0ce18b44f 12 }
rottenegg 21:f3b0ce18b44f 13
rottenegg 21:f3b0ce18b44f 14 void SceneFunctions::reset_variables() {
rottenegg 21:f3b0ce18b44f 15 _progress = 0;
rottenegg 21:f3b0ce18b44f 16 _p[0] = true;
rottenegg 21:f3b0ce18b44f 17 _p[1] = true;
rottenegg 21:f3b0ce18b44f 18 _p[2] = true;
rottenegg 21:f3b0ce18b44f 19 }
rottenegg 9:ac396c818874 20
rottenegg 9:ac396c818874 21 void SceneFunctions::deletebutton() {
rottenegg 9:ac396c818874 22 delete _BOK;
rottenegg 9:ac396c818874 23 }
rottenegg 9:ac396c818874 24
rottenegg 9:ac396c818874 25 //Ultility Functions
rottenegg 17:7d4d8905b608 26 void SceneFunctions::transition(Bitmap &lcd) {
rottenegg 9:ac396c818874 27 for (int i = 0;i < 84;i++) {
rottenegg 9:ac396c818874 28 lcd.drawRect(0,0,i,48,FILL_BLACK);
rottenegg 9:ac396c818874 29 lcd.refresh();
rottenegg 9:ac396c818874 30 }
rottenegg 9:ac396c818874 31 for (int i = 0;i < 84;i++) {
rottenegg 9:ac396c818874 32 lcd.drawRect(0,0,i,48,FILL_WHITE);
rottenegg 9:ac396c818874 33 lcd.refresh();
rottenegg 9:ac396c818874 34 }
rottenegg 9:ac396c818874 35 }
rottenegg 9:ac396c818874 36
rottenegg 17:7d4d8905b608 37 void SceneFunctions::lockin(Bitmap &lcd) {
rottenegg 9:ac396c818874 38 while (_BOK->read() == 0) {
rottenegg 9:ac396c818874 39 lcd.printString(" ",0,5);
rottenegg 9:ac396c818874 40 lcd.refresh();
rottenegg 9:ac396c818874 41 wait(0.15);
rottenegg 9:ac396c818874 42 lcd.printString("...Press B...",0,5);
rottenegg 9:ac396c818874 43 lcd.refresh();
rottenegg 9:ac396c818874 44 wait(0.15);
rottenegg 9:ac396c818874 45 }
rottenegg 9:ac396c818874 46 }
rottenegg 9:ac396c818874 47
rottenegg 17:7d4d8905b608 48 void SceneFunctions::flash(Bitmap &lcd) {
rottenegg 9:ac396c818874 49 for(int i = 0; i < 4; i++) {
rottenegg 9:ac396c818874 50 lcd.drawRect(0,0,84,48,FILL_BLACK);
rottenegg 9:ac396c818874 51 lcd.refresh();
rottenegg 9:ac396c818874 52 wait(0.15);
rottenegg 9:ac396c818874 53 lcd.drawRect(0,0,84,48,FILL_WHITE);
rottenegg 9:ac396c818874 54 lcd.refresh();
rottenegg 9:ac396c818874 55 wait(0.15);
rottenegg 9:ac396c818874 56 };
rottenegg 9:ac396c818874 57 };
rottenegg 9:ac396c818874 58
rottenegg 9:ac396c818874 59 //Unique to Scene Functions
rottenegg 9:ac396c818874 60 //scene 0 Functions
rottenegg 9:ac396c818874 61 void SceneFunctions::set_scene0(CaMove &CM) {
rottenegg 9:ac396c818874 62 CM.set_region(1, 28, 12, 17); //event 0
rottenegg 9:ac396c818874 63 CM.set_region(66, 15, 21, 24); //event 1
rottenegg 9:ac396c818874 64 };
rottenegg 9:ac396c818874 65 //pre funtions
rottenegg 17:7d4d8905b608 66 void SceneFunctions::obj0_scene0(Bitmap &lcd) {
rottenegg 9:ac396c818874 67 lcd.drawRect(32,1,20,2,FILL_BLACK);
rottenegg 9:ac396c818874 68 };
rottenegg 9:ac396c818874 69 //pos functions
rottenegg 17:7d4d8905b608 70 void SceneFunctions::event0_scene0(Bitmap &lcd) {
rottenegg 9:ac396c818874 71 this->transition(lcd);
rottenegg 9:ac396c818874 72 lcd.clear();
rottenegg 9:ac396c818874 73 lcd.printString("Hello My Name",0,0);
rottenegg 9:ac396c818874 74 lcd.printString("Veigar I Shall",0,1);
rottenegg 9:ac396c818874 75 lcd.printString("Help You Find",0,2);
rottenegg 9:ac396c818874 76 lcd.printString("What You Seek",0,3);
rottenegg 9:ac396c818874 77 lcd.printString("Now go ... ",0,4);
rottenegg 9:ac396c818874 78 lcd.refresh();
rottenegg 9:ac396c818874 79 this->lockin(lcd);
rottenegg 9:ac396c818874 80 this->transition(lcd);
rottenegg 9:ac396c818874 81 }
rottenegg 9:ac396c818874 82
rottenegg 9:ac396c818874 83 //event 1
rottenegg 17:7d4d8905b608 84 void SceneFunctions::event1_scene0(Bitmap &lcd) {
rottenegg 9:ac396c818874 85 this->transition(lcd);
rottenegg 9:ac396c818874 86 lcd.clear();
rottenegg 9:ac396c818874 87 lcd.printString("It's a Weird",0,0);
rottenegg 9:ac396c818874 88 lcd.printString("quite eerie...",0,1);
rottenegg 9:ac396c818874 89 lcd.printString("Statue !!",0,2);
rottenegg 9:ac396c818874 90 lcd.refresh();
rottenegg 9:ac396c818874 91 this->lockin(lcd);
rottenegg 9:ac396c818874 92 this->transition(lcd);
rottenegg 9:ac396c818874 93 }
rottenegg 9:ac396c818874 94
rottenegg 9:ac396c818874 95 //scene1 Funtions
rottenegg 9:ac396c818874 96 void SceneFunctions::set_scene1(CaMove &CM) {
rottenegg 9:ac396c818874 97 CM.set_region(2, 38, 8, 7); //event 0
rottenegg 9:ac396c818874 98 CM.set_region(72, 2, 8, 7); //event 1
rottenegg 9:ac396c818874 99 };
rottenegg 9:ac396c818874 100
rottenegg 9:ac396c818874 101 //pre funtions
rottenegg 17:7d4d8905b608 102 void SceneFunctions::obj0_scene1(Bitmap &lcd) {
rottenegg 9:ac396c818874 103 lcd.drawLine(30,40,31,20,0);
rottenegg 9:ac396c818874 104 lcd.drawLine(55,40,55,20,1);
rottenegg 9:ac396c818874 105 lcd.drawRect(5,1,20,2,FILL_BLACK);
rottenegg 9:ac396c818874 106 }
rottenegg 9:ac396c818874 107
rottenegg 17:7d4d8905b608 108 void SceneFunctions::obj1_scene1(Bitmap &lcd) {
rottenegg 9:ac396c818874 109 lcd.drawRect(32,1,20,2,FILL_BLACK);
rottenegg 9:ac396c818874 110 }
rottenegg 9:ac396c818874 111
rottenegg 9:ac396c818874 112
rottenegg 9:ac396c818874 113 //pos functions
rottenegg 17:7d4d8905b608 114 void SceneFunctions::event0_scene1(Bitmap &lcd) {
rottenegg 9:ac396c818874 115 lcd.drawRect(74,3,6,3,FILL_WHITE);
rottenegg 9:ac396c818874 116 lcd.drawLine(4,39,7,41,1);
rottenegg 9:ac396c818874 117 lcd.refresh();
rottenegg 9:ac396c818874 118 wait(0.2);
rottenegg 9:ac396c818874 119 lcd.drawRect(74,3,6,3,FILL_WHITE);
rottenegg 9:ac396c818874 120 lcd.drawLine(9,39,7,41,1);
rottenegg 9:ac396c818874 121 lcd.refresh();
rottenegg 9:ac396c818874 122 wait(0.2);
rottenegg 9:ac396c818874 123 }
rottenegg 9:ac396c818874 124
rottenegg 17:7d4d8905b608 125 void SceneFunctions::event1_scene1(Bitmap &lcd,CaMove &CM) {
rottenegg 9:ac396c818874 126 lcd.drawRect(74,3,6,3,FILL_WHITE);
rottenegg 9:ac396c818874 127 lcd.drawLine(74,3,77,5,1);
rottenegg 9:ac396c818874 128 lcd.refresh();
rottenegg 9:ac396c818874 129 wait(0.2);
rottenegg 9:ac396c818874 130 lcd.drawRect(74,3,6,3,FILL_WHITE);
rottenegg 9:ac396c818874 131 lcd.drawLine(79,3,77,5,1);
rottenegg 9:ac396c818874 132 lcd.refresh();
rottenegg 9:ac396c818874 133 wait(0.2);
rottenegg 14:165fff6d1854 134 CM.spawn(42,-15);
rottenegg 9:ac396c818874 135 }
rottenegg 10:4fda7b01484a 136
rottenegg 10:4fda7b01484a 137 //Scene 2 Functions
rottenegg 10:4fda7b01484a 138 void SceneFunctions::set_scene2(CaMove &CM) {
rottenegg 10:4fda7b01484a 139 CM.set_region(9, 17, 10, 14); //event 0
rottenegg 10:4fda7b01484a 140
rottenegg 10:4fda7b01484a 141 };
rottenegg 10:4fda7b01484a 142 //pre Functions
rottenegg 17:7d4d8905b608 143 void SceneFunctions::obj0_scene2(Bitmap &lcd) {
rottenegg 17:7d4d8905b608 144 lcd.renderBMP(MISC[0],9,17);
rottenegg 10:4fda7b01484a 145 lcd.drawLine(83,13,83,33,1); //right
rottenegg 10:4fda7b01484a 146 lcd.drawLine(47,0,67,0,1); // top
rottenegg 10:4fda7b01484a 147 lcd.drawLine(47,47,67,47,1); //bot
rottenegg 10:4fda7b01484a 148 }
rottenegg 10:4fda7b01484a 149
rottenegg 17:7d4d8905b608 150 void SceneFunctions::obj1_scene2(Bitmap &lcd,int rng) {
rottenegg 10:4fda7b01484a 151 switch(rng) {
rottenegg 10:4fda7b01484a 152 case 0:
rottenegg 10:4fda7b01484a 153 lcd.drawLine(83,13,83,33,1); //r
rottenegg 10:4fda7b01484a 154 lcd.drawLine(47,0,67,0,1); // t
rottenegg 10:4fda7b01484a 155 break;
rottenegg 10:4fda7b01484a 156 case 1:
rottenegg 10:4fda7b01484a 157 lcd.drawLine(47,47,67,47,1); //b
rottenegg 10:4fda7b01484a 158 lcd.drawLine(83,13,83,33,1); //r
rottenegg 10:4fda7b01484a 159 break;
rottenegg 10:4fda7b01484a 160 case 2:
rottenegg 10:4fda7b01484a 161 lcd.drawLine(47,47,67,47,1); //b
rottenegg 10:4fda7b01484a 162 lcd.drawLine(47,0,67,0,1); // t
rottenegg 10:4fda7b01484a 163 break;
rottenegg 10:4fda7b01484a 164 }
rottenegg 10:4fda7b01484a 165 }
rottenegg 10:4fda7b01484a 166
rottenegg 10:4fda7b01484a 167 //pos Function
rottenegg 21:f3b0ce18b44f 168 void SceneFunctions::event0_scene2(Bitmap &lcd,CaMove &CM,WDplayer &wav) {
rottenegg 10:4fda7b01484a 169 this->transition(lcd);
rottenegg 10:4fda7b01484a 170 lcd.clear();
rottenegg 17:7d4d8905b608 171 lcd.renderBMP(MISC[1],0,0);
rottenegg 10:4fda7b01484a 172 lcd.refresh();
rottenegg 10:4fda7b01484a 173 wait(1);
rottenegg 10:4fda7b01484a 174 CM.delete_regions();
rottenegg 10:4fda7b01484a 175 lcd.clear();
rottenegg 10:4fda7b01484a 176 lcd.printString("Help Me Please",0,0);
rottenegg 10:4fda7b01484a 177 lcd.refresh();
rottenegg 10:4fda7b01484a 178 wait(0.5);
rottenegg 10:4fda7b01484a 179 lcd.printString("I NEED YOUR",0,1);
rottenegg 10:4fda7b01484a 180 lcd.printString("BLOOOD !!!",0,2);
rottenegg 10:4fda7b01484a 181 lcd.refresh();
rottenegg 10:4fda7b01484a 182 wait(1);
rottenegg 13:95323e0f2fcb 183 CM.init(35,17,Fd);
rottenegg 10:4fda7b01484a 184 CM.spawn(9,17);
rottenegg 10:4fda7b01484a 185 lcd.inverseMode();
rottenegg 10:4fda7b01484a 186 }
rottenegg 10:4fda7b01484a 187
rottenegg 10:4fda7b01484a 188 //Scene 3 Functions
rottenegg 10:4fda7b01484a 189 void SceneFunctions::set_scene3(CaMove &CM) {
rottenegg 10:4fda7b01484a 190 CM.set_region(72, 39, 10, 7); //event 0
rottenegg 10:4fda7b01484a 191 CM.set_region(73, 11, 10, 17); //event 1
rottenegg 10:4fda7b01484a 192 CM.set_region(64, 5, 10, 14); //event 2
rottenegg 10:4fda7b01484a 193 CM.set_region(42, 2, 11, 18); //event 3
rottenegg 10:4fda7b01484a 194 };
rottenegg 10:4fda7b01484a 195
rottenegg 10:4fda7b01484a 196 //pre Functions
rottenegg 17:7d4d8905b608 197 void SceneFunctions::obj0_scene3(Bitmap &lcd) {
rottenegg 10:4fda7b01484a 198 lcd.drawLine(76,42,78,40,1);
rottenegg 10:4fda7b01484a 199 lcd.drawRect(74,40,2,3,FILL_WHITE);
rottenegg 10:4fda7b01484a 200 lcd.drawRect(28,29,11,13,FILL_WHITE);
rottenegg 10:4fda7b01484a 201 lcd.drawRect(14,31,9,11,FILL_BLACK);
rottenegg 10:4fda7b01484a 202 lcd.drawLine(16,33,20,33,0);
rottenegg 10:4fda7b01484a 203 lcd.drawLine(20,33,20,37,0);
rottenegg 10:4fda7b01484a 204 lcd.drawLine(20,37,16,37,0);
rottenegg 10:4fda7b01484a 205 }
rottenegg 10:4fda7b01484a 206
rottenegg 17:7d4d8905b608 207 void SceneFunctions::obj1_scene3(Bitmap &lcd) {
rottenegg 10:4fda7b01484a 208 lcd.setPixel(77,14,false);
rottenegg 10:4fda7b01484a 209 }
rottenegg 21:f3b0ce18b44f 210
rottenegg 17:7d4d8905b608 211 void SceneFunctions::obj3_scene3(Bitmap &lcd) {
rottenegg 17:7d4d8905b608 212 lcd.renderBMP(MISC[2],21,8);
rottenegg 10:4fda7b01484a 213 }
rottenegg 10:4fda7b01484a 214
rottenegg 17:7d4d8905b608 215 void SceneFunctions::obj4_scene3(Bitmap &lcd) {
rottenegg 10:4fda7b01484a 216 if (_progress < 3) {
rottenegg 10:4fda7b01484a 217 lcd.drawRect(55,46,16,2,FILL_BLACK);
rottenegg 10:4fda7b01484a 218 }
rottenegg 10:4fda7b01484a 219 }
rottenegg 10:4fda7b01484a 220
rottenegg 10:4fda7b01484a 221 //pos functions
rottenegg 17:7d4d8905b608 222 void SceneFunctions::event0_scene3(Bitmap &lcd) {
rottenegg 10:4fda7b01484a 223 if(_p[0]) {
rottenegg 10:4fda7b01484a 224 _p[0] = false;
rottenegg 10:4fda7b01484a 225 _progress++;
rottenegg 10:4fda7b01484a 226 }
rottenegg 10:4fda7b01484a 227 }
rottenegg 10:4fda7b01484a 228
rottenegg 10:4fda7b01484a 229
rottenegg 17:7d4d8905b608 230 void SceneFunctions::event1_scene3(Bitmap &lcd) {
rottenegg 10:4fda7b01484a 231 this->transition(lcd);
rottenegg 10:4fda7b01484a 232 lcd.clear();
rottenegg 10:4fda7b01484a 233 lcd.printString("The Statue",0,0);
rottenegg 10:4fda7b01484a 234 lcd.printString("Looks like a",0,1);
rottenegg 10:4fda7b01484a 235 lcd.printString("Head But Eye",0,2);
rottenegg 10:4fda7b01484a 236 lcd.printString("Missing I Stab",0,3);
rottenegg 10:4fda7b01484a 237 lcd.printString("In a New One.",0,4);
rottenegg 10:4fda7b01484a 238 lcd.refresh();
rottenegg 10:4fda7b01484a 239 if(_p[2]) {
rottenegg 10:4fda7b01484a 240 _p[2] = false;
rottenegg 10:4fda7b01484a 241 _progress++;
rottenegg 10:4fda7b01484a 242 }
rottenegg 10:4fda7b01484a 243 this->lockin(lcd);
rottenegg 10:4fda7b01484a 244 this->transition(lcd);
rottenegg 10:4fda7b01484a 245 }
rottenegg 10:4fda7b01484a 246
rottenegg 10:4fda7b01484a 247
rottenegg 17:7d4d8905b608 248 void SceneFunctions::event2_scene3(Bitmap &lcd) {
rottenegg 10:4fda7b01484a 249 this->transition(lcd);
rottenegg 10:4fda7b01484a 250 lcd.clear();
rottenegg 10:4fda7b01484a 251 lcd.printString("Welcome to",0,0);
rottenegg 10:4fda7b01484a 252 lcd.printString("Mirror Room",0,1);
rottenegg 10:4fda7b01484a 253 lcd.printString("But Beware Not",0,2);
rottenegg 10:4fda7b01484a 254 lcd.printString("Touch Sarced",0,3);
rottenegg 10:4fda7b01484a 255 lcd.printString("!!!ITEM!!!",0,4);
rottenegg 10:4fda7b01484a 256 lcd.refresh();
rottenegg 10:4fda7b01484a 257 if(_p[1]) {
rottenegg 10:4fda7b01484a 258 _p[1] = false;
rottenegg 10:4fda7b01484a 259 _progress++;
rottenegg 10:4fda7b01484a 260 }
rottenegg 10:4fda7b01484a 261 this->lockin(lcd);
rottenegg 10:4fda7b01484a 262 this->transition(lcd);
rottenegg 10:4fda7b01484a 263 }
rottenegg 10:4fda7b01484a 264
rottenegg 17:7d4d8905b608 265 void SceneFunctions::event3_scene3(Bitmap &lcd,CaMove &CM) {
rottenegg 10:4fda7b01484a 266 this->transition(lcd);
rottenegg 10:4fda7b01484a 267 lcd.clear();
rottenegg 10:4fda7b01484a 268 CM.delete_regions();
rottenegg 10:4fda7b01484a 269 lcd.printString("CURSE YOU",0,0);
rottenegg 10:4fda7b01484a 270 lcd.refresh();
rottenegg 10:4fda7b01484a 271 wait(0.5);
rottenegg 10:4fda7b01484a 272 CM.spawn(21,8);
rottenegg 10:4fda7b01484a 273 lcd.inverseMode();
rottenegg 10:4fda7b01484a 274 }
rottenegg 15:3d29fb195958 275
rottenegg 15:3d29fb195958 276 //Scene 4 Functions
rottenegg 15:3d29fb195958 277 void SceneFunctions::set_scene4(CaMove &CM) {
rottenegg 15:3d29fb195958 278 CM.set_region(14, 16, 3, 20); //event 0
rottenegg 15:3d29fb195958 279 }
rottenegg 15:3d29fb195958 280 //pre functions
rottenegg 17:7d4d8905b608 281 void SceneFunctions::obj1_scene4(Bitmap &lcd) {
rottenegg 15:3d29fb195958 282 if (_progress < 5) {
rottenegg 15:3d29fb195958 283 _progress = 7;
rottenegg 15:3d29fb195958 284 }
rottenegg 15:3d29fb195958 285 if (_progress < 15) {
rottenegg 15:3d29fb195958 286 lcd.drawRect((20 -_progress),18,2,18,FILL_BLACK);
rottenegg 15:3d29fb195958 287 }
rottenegg 15:3d29fb195958 288 }
rottenegg 26:716bcd47f3ca 289 void SceneFunctions::obj2_scene4(Bitmap &lcd,int rng) {
rottenegg 26:716bcd47f3ca 290 switch(rng) {
rottenegg 26:716bcd47f3ca 291 case 2:
rottenegg 26:716bcd47f3ca 292 lcd.renderBMP(MISC[0],4,2);
rottenegg 26:716bcd47f3ca 293 break;
rottenegg 26:716bcd47f3ca 294 case 0:
rottenegg 26:716bcd47f3ca 295 lcd.renderBMP(MISC[2],4,2);
rottenegg 26:716bcd47f3ca 296 break;
rottenegg 26:716bcd47f3ca 297 }
rottenegg 15:3d29fb195958 298 }
rottenegg 17:7d4d8905b608 299 void SceneFunctions::obj3_scene4(Bitmap &lcd) {
rottenegg 15:3d29fb195958 300 if (_progress > 7) {
rottenegg 15:3d29fb195958 301 switch (_progress) {
rottenegg 15:3d29fb195958 302 default:
rottenegg 15:3d29fb195958 303 case 15:
rottenegg 15:3d29fb195958 304 lcd.drawLine(45,4,45,10,1);
rottenegg 15:3d29fb195958 305 case 14:
rottenegg 15:3d29fb195958 306 lcd.drawLine(45,4,49,7,1);
rottenegg 15:3d29fb195958 307 case 13:
rottenegg 15:3d29fb195958 308 lcd.drawLine(49,7,45,10,1);
rottenegg 15:3d29fb195958 309 case 12:
rottenegg 15:3d29fb195958 310 lcd.drawLine(54,5,55,10,1);
rottenegg 15:3d29fb195958 311 case 11:
rottenegg 15:3d29fb195958 312 lcd.drawLine(61,4,59,10,1);
rottenegg 15:3d29fb195958 313 case 10:
rottenegg 15:3d29fb195958 314 lcd.drawLine(61,4,66,3,1);
rottenegg 15:3d29fb195958 315 case 9:
rottenegg 15:3d29fb195958 316 lcd.drawLine(59,10,65,9,1);
rottenegg 15:3d29fb195958 317 case 8:
rottenegg 15:3d29fb195958 318 lcd.drawLine(66,7,60,7,1);
rottenegg 15:3d29fb195958 319 break;
rottenegg 15:3d29fb195958 320 }
rottenegg 15:3d29fb195958 321 }
rottenegg 15:3d29fb195958 322 }
rottenegg 21:f3b0ce18b44f 323 Serial x(USBTX,USBRX);
rottenegg 15:3d29fb195958 324 //pos function
rottenegg 21:f3b0ce18b44f 325 void SceneFunctions::event0_scene4(Bitmap &lcd,CaMove &CM,WDplayer &wav) {
rottenegg 15:3d29fb195958 326 if (_progress == 8) {
rottenegg 15:3d29fb195958 327 CM.spawn(84,19);
rottenegg 15:3d29fb195958 328 }
rottenegg 15:3d29fb195958 329 CM.delete_regions();
rottenegg 15:3d29fb195958 330 CM.set_region((18 - _progress),17,6,18);
rottenegg 15:3d29fb195958 331 _progress++;
rottenegg 15:3d29fb195958 332 }