Game codes for Pokemon Academy Yiu Fai Kwok - 201198802 I have read the University Regulations on Plagiarism and state that the work covered by this declaration is my own and does not contain any unacknowledged work from other sources.

Dependencies:   mbed FXOS8700CQ mbed-rtos

Revision:
2:464c7e62d97d
Child:
10:adff3c804985
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Characters/Bulbasaur.cpp	Wed Apr 03 03:06:00 2019 +0000
@@ -0,0 +1,90 @@
+#include "Bulbasaur.h"
+
+Bulbasaur::Bulbasaur()
+{
+
+}
+
+Bulbasaur::~Bulbasaur()
+{
+
+}
+
+//Enumerate instruction menu from page 1 - 3
+enum Page {
+    PAGE_1, PAGE_2, PAGE_3   
+};
+
+void Bulbasaur::draw_cha1_sprite(int pos_x, int pos_y,N5110 &lcd)
+{
+    static int bulbasaur_data[] = {
+        0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,
+        0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,
+        0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,1,0,0,0,0,
+        0,0,0,0,0,0,0,1,1,0,0,1,0,0,1,0,1,1,0,0,
+        0,0,0,1,1,0,1,0,0,0,1,1,0,0,1,0,0,0,1,0,
+        0,0,1,0,0,1,1,0,0,1,0,1,0,0,0,1,0,0,0,1,
+        0,0,1,0,0,0,1,1,1,0,1,0,0,0,0,0,1,0,0,1,
+        0,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,0,1,
+        0,1,0,0,0,0,0,0,0,1,1,1,0,0,0,0,1,0,1,0,
+        1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1,1,1,0,
+        1,1,0,0,0,0,0,0,0,0,1,0,1,1,1,0,0,0,1,0,
+        1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1,0,1,0,
+        1,0,0,0,0,0,1,1,0,0,0,0,1,0,0,1,1,1,0,0,
+        0,1,0,0,0,0,1,1,0,0,0,1,0,0,1,0,0,0,0,0,
+        0,0,1,1,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,
+        0,0,0,0,1,1,1,1,1,1,1,0,1,0,1,0,0,0,0,0,
+        0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0
+    };
+    
+    _pos_x = pos_x;
+    _pos_y = pos_y;
+    lcd.drawSprite(_pos_x, _pos_y, 17, 20, bulbasaur_data);
+}
+
+void Bulbasaur::description(Gamepad &pad, N5110 &lcd)
+{
+    Page currentPage = PAGE_1;
+    int fps = 8.0;
+    static int instruct_data[] = {
+        1,1,1,1,1,1,1,
+        0,1,1,1,1,1,0,
+        0,0,1,1,1,0,0,
+        0,0,0,1,0,0,0
+    };
+    
+    while(pad.check_event(Gamepad::B_PRESSED) == false){
+        switch (currentPage) {
+            case PAGE_1:
+                lcd.clear();
+                lcd.printString("Bulbasaur",0,0);
+                lcd.printString("is so lazy",0,1);
+                lcd.printString("that he never",0,2);
+                lcd.printString("finds time to",0,3);
+                lcd.printString("do actual work",0,4);
+                lcd.drawSprite(39, 44, 4, 7, instruct_data);
+                lcd.refresh();
+                if(pad.get_direction() == S){currentPage = PAGE_2;}
+                wait(1.0f/fps);
+            break;
+            case PAGE_2:
+                lcd.clear();
+                lcd.printString("Easily lured",0,0);
+                lcd.printString("by YouTube",0,1);
+                lcd.printString("and social",0,2);
+                lcd.printString("apps! Motivate",0,3);
+                lcd.printString("him so that he",0,4);
+                lcd.drawSprite(39, 44, 4, 7, instruct_data);
+                lcd.refresh();
+                if(pad.get_direction() == S){currentPage = PAGE_3;}
+                wait(1.0f/fps);
+            break;
+            case PAGE_3:
+                lcd.clear();
+                lcd.printString("can graduate!",0,0);
+                lcd.printString("Press B",0,5);
+                lcd.refresh();
+                wait(1.0f/fps);
+        }
+    }
+}
\ No newline at end of file