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:
11:5a6b9dffd78a
Parent:
10:adff3c804985
Child:
12:71683453f66a
--- a/Characters/Bulbasaur.cpp	Fri Apr 12 17:19:14 2019 +0000
+++ b/Characters/Bulbasaur.cpp	Sun Apr 14 15:56:58 2019 +0000
@@ -17,29 +17,29 @@
 
 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
+    int bulbasaur_data[17][20] = {
+        {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);
+    lcd.drawSprite(_pos_x, _pos_y, 17, 20, (int *)bulbasaur_data);
 }
 
 void Bulbasaur::evo_one(N5110 &lcd)
@@ -91,11 +91,11 @@
 {
     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
+    int instruct_data[4][7] = {
+        {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){
@@ -107,7 +107,7 @@
                 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.drawSprite(39, 44, 4, 7, (int*)instruct_data);
                 lcd.refresh();
                 if(pad.get_direction() == S){currentPage = PAGE_2;}
                 wait(1.0f/fps);
@@ -119,7 +119,7 @@
                 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.drawSprite(39, 44, 4, 7, (int*)instruct_data);
                 lcd.refresh();
                 if(pad.get_direction() == S){currentPage = PAGE_3;}
                 wait(1.0f/fps);