Dependencies:   mbed FATFileSystem

Revision:
10:4fda7b01484a
Parent:
9:ac396c818874
Child:
13:95323e0f2fcb
--- a/SceneCreator/SceneFunctions.cpp	Thu Apr 25 01:31:32 2019 +0000
+++ b/SceneCreator/SceneFunctions.cpp	Fri Apr 26 02:31:11 2019 +0000
@@ -1,9 +1,14 @@
 #include "SceneFunctions.h"
+#include "MiscPaths.h"
 
 //Constructor Functions
 void SceneFunctions::set_buttonPin(PinName pin) {
     _BOK = (new DigitalIn(pin));
     _BOK->mode(PullDown);
+    _progress = 0;
+    _p[0] = true;
+    _p[1] = true;
+    _p[2] = true;
     }
 
 void SceneFunctions::deletebutton() {
@@ -120,3 +125,142 @@
     lcd.refresh();
     wait(0.2);
 }
+
+//Scene 2 Functions
+void SceneFunctions::set_scene2(CaMove &CM) {
+    CM.set_region(9, 17, 10, 14); //event 0
+    
+};
+//pre Functions
+void SceneFunctions::obj0_scene2(N5110 &lcd) {
+    Bitmap::renderBMP(MISC[0],lcd,9,17);
+    lcd.drawLine(83,13,83,33,1); //right
+    lcd.drawLine(47,0,67,0,1); // top
+    lcd.drawLine(47,47,67,47,1); //bot
+}
+
+void SceneFunctions::obj1_scene2(N5110 &lcd,int rng) {
+    switch(rng) {
+    case 0:
+        lcd.drawLine(83,13,83,33,1); //r
+        lcd.drawLine(47,0,67,0,1); // t
+    break;
+    case 1:
+        lcd.drawLine(47,47,67,47,1); //b
+        lcd.drawLine(83,13,83,33,1); //r
+    break;
+    case 2:
+        lcd.drawLine(47,47,67,47,1); //b
+        lcd.drawLine(47,0,67,0,1); // t
+    break;
+    }
+}
+
+//pos Function
+void SceneFunctions::event0_scene2(N5110 &lcd,CaMove &CM) {
+    this->transition(lcd);
+    lcd.clear();
+    Bitmap::renderBMP(MISC[1],lcd,0,0);
+    lcd.refresh();
+    wait(1);
+    CM.delete_regions();
+    lcd.clear();
+    lcd.printString("Help Me Please",0,0);
+    lcd.refresh();
+    wait(0.5);
+    lcd.printString("I NEED YOUR",0,1);
+    lcd.printString("BLOOOD !!!",0,2);
+    lcd.refresh();
+    wait(1);
+    CM.init(29,17,Fd);
+    CM.spawn(9,17);
+    lcd.inverseMode();
+}
+
+//Scene 3 Functions
+void SceneFunctions::set_scene3(CaMove &CM) {
+    CM.set_region(72, 39, 10, 7);  //event 0
+    CM.set_region(73, 11, 10, 17); //event 1
+    CM.set_region(64, 5, 10, 14);  //event 2
+    CM.set_region(42, 2, 11, 18);  //event 3
+};
+
+//pre Functions
+void SceneFunctions::obj0_scene3(N5110 &lcd) {
+    lcd.drawLine(76,42,78,40,1);
+    lcd.drawRect(74,40,2,3,FILL_WHITE);
+    lcd.drawRect(28,29,11,13,FILL_WHITE);
+    lcd.drawRect(14,31,9,11,FILL_BLACK);
+    lcd.drawLine(16,33,20,33,0);
+    lcd.drawLine(20,33,20,37,0);
+    lcd.drawLine(20,37,16,37,0);  
+}
+
+void SceneFunctions::obj1_scene3(N5110 &lcd) {
+    lcd.setPixel(77,14,false);
+}
+//obj 2 not required
+void SceneFunctions::obj3_scene3(N5110 &lcd) {
+    Bitmap::renderBMP(MISC[2],lcd,21,8);
+}
+
+void SceneFunctions::obj4_scene3(N5110 &lcd) {
+    if (_progress < 3) {
+        lcd.drawRect(55,46,16,2,FILL_BLACK);
+    }
+}
+
+//pos functions
+void SceneFunctions::event0_scene3(N5110 &lcd) {
+    if(_p[0]) {
+        _p[0] = false;
+        _progress++;
+    }
+}
+
+
+void SceneFunctions::event1_scene3(N5110 &lcd) {
+    this->transition(lcd);
+    lcd.clear();
+    lcd.printString("The Statue",0,0);
+    lcd.printString("Looks like a",0,1);
+    lcd.printString("Head But Eye",0,2);
+    lcd.printString("Missing I Stab",0,3);
+    lcd.printString("In a New One.",0,4);
+    lcd.refresh();
+    if(_p[2]) {
+        _p[2] = false;
+        _progress++;
+    }
+    this->lockin(lcd);
+    this->transition(lcd);
+}
+
+
+void SceneFunctions::event2_scene3(N5110 &lcd) {
+    this->transition(lcd);
+    lcd.clear();
+    lcd.printString("Welcome to",0,0);
+    lcd.printString("Mirror Room",0,1);
+    lcd.printString("But Beware Not",0,2);
+    lcd.printString("Touch Sarced",0,3);
+    lcd.printString("!!!ITEM!!!",0,4);
+    lcd.refresh();
+    if(_p[1]) {
+        _p[1] = false;
+        _progress++;
+    }
+    this->lockin(lcd);
+    this->transition(lcd);
+}
+
+void SceneFunctions::event3_scene3(N5110 &lcd,CaMove &CM) {
+    this->transition(lcd);
+    lcd.clear();
+    CM.delete_regions();
+    lcd.printString("CURSE YOU",0,0);
+    lcd.refresh();
+    wait(0.5);
+    CM.spawn(21,8);
+    lcd.inverseMode();
+}