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:
10:adff3c804985
Parent:
8:d707bb3b9106
Child:
11:5a6b9dffd78a
diff -r 1395c98b58fc -r adff3c804985 Exam/Exam.cpp
--- a/Exam/Exam.cpp	Thu Apr 11 16:17:38 2019 +0000
+++ b/Exam/Exam.cpp	Fri Apr 12 17:19:14 2019 +0000
@@ -70,7 +70,7 @@
                 lcd.refresh();
                 if(pad.get_direction() == S){currentPage = PAGE_2;}
                 if(pad.get_direction() == N){currentPage = PAGE_1;}
-                wait(2.0f/fps);
+                wait(1.0f/fps);
             break;
             case PAGE_2:
                 lcd.clear();
@@ -83,7 +83,7 @@
                 lcd.refresh();
                 if(pad.get_direction() == S){currentPage = PAGE_3;}
                 if(pad.get_direction() == N){currentPage = PAGE_1;}
-                wait(2.0f/fps);
+                wait(1.0f/fps);
             break;
             case PAGE_3:
                 lcd.clear();
@@ -111,7 +111,7 @@
                 || (pad.check_event(Gamepad::Y_PRESSED) == true)){
                     currentPage = PAGE_4;
                 }
-                wait(2.0f/fps);
+                wait(1.0f/fps);
             break;
             case PAGE_4:
                 lcd.clear();
@@ -124,7 +124,7 @@
                 lcd.refresh();
                 if(pad.get_direction() == S){currentPage = PAGE_5;}
                 if(pad.get_direction() == N){currentPage = PAGE_4;}
-                wait(2.0f/fps);
+                wait(1.0f/fps);
             break;
             case PAGE_5:
                 lcd.clear();
@@ -135,7 +135,7 @@
                 lcd.refresh();
                 if(pad.get_direction() == S){currentPage = PAGE_6;}
                 if(pad.get_direction() == N){currentPage = PAGE_4;}
-                wait(2.0f/fps);
+                wait(1.0f/fps);
             break;
             case PAGE_6:
                 lcd.clear();
@@ -163,7 +163,7 @@
                 || (pad.check_event(Gamepad::X_PRESSED) == true)){
                     currentPage = PAGE_7;
                 }
-                wait(2.0f/fps);
+                wait(1.0f/fps);
             break;
             case PAGE_7:
                 lcd.clear();
@@ -176,7 +176,7 @@
                 lcd.refresh();
                 if(pad.get_direction() == S){currentPage = PAGE_8;}
                 if(pad.get_direction() == N){currentPage = PAGE_7;}
-                wait(2.0f/fps);
+                wait(1.0f/fps);
             break;
             case PAGE_8:
                 lcd.clear();
@@ -186,10 +186,10 @@
                 lcd.refresh();
                 if(pad.get_direction() == S){currentPage = PAGE_9;}
                 if(pad.get_direction() == N){currentPage = PAGE_7;}
-                wait(2.0f/fps);
+                wait(1.0f/fps);
             break;
             case PAGE_9:
-                pad.init();
+                lcd.clear();
                 if(point > 2) {
                     lcd.printString("A. -ln|cos(x)|",0,2);
                     lcd.printString("B. -arctan(x)",0,3);
@@ -214,7 +214,7 @@
                 || (pad.check_event(Gamepad::X_PRESSED) == true)){
                     currentPage = PAGE_10;
                 }
-                wait(2.0f/fps);
+                wait(1.0f/fps);
             break;
             case PAGE_10:
                 lcd.clear();
@@ -223,7 +223,7 @@
                 lcd.printString("PRESS START",0,5);
                 lcd.refresh();
                 if(pad.check_event(Gamepad::START_PRESSED) == true) {finished = true;}
-                wait(2.0f/fps);
+                wait(1.0f/fps);
             break;
         }
     }
@@ -264,7 +264,7 @@
                 lcd.refresh();
                 if(pad.get_direction() == S){currentPage = PAGE_2;}
                 if(pad.get_direction() == N){currentPage = PAGE_1;}
-                wait(2.0f/fps);
+                wait(1.0f/fps);
             break;
             case PAGE_2:
                 lcd.clear();
@@ -277,7 +277,7 @@
                 lcd.refresh();
                 if(pad.get_direction() == S){currentPage = PAGE_3;}
                 if(pad.get_direction() == N){currentPage = PAGE_1;}
-                wait(2.0f/fps);
+                wait(1.0f/fps);
             break;
             case PAGE_3:
                 lcd.clear();
@@ -305,7 +305,7 @@
                 || (pad.check_event(Gamepad::Y_PRESSED) == true)){
                     currentPage = PAGE_4;
                 }
-                wait(2.0f/fps);
+                wait(1.0f/fps);
             break;
             case PAGE_4:
                 lcd.clear();
@@ -318,7 +318,7 @@
                 lcd.refresh();
                 if(pad.get_direction() == S){currentPage = PAGE_5;}
                 if(pad.get_direction() == N){currentPage = PAGE_4;}
-                wait(2.0f/fps);
+                wait(1.0f/fps);
             break;
             case PAGE_5:
                 lcd.clear();
@@ -331,7 +331,7 @@
                 lcd.refresh();
                 if(pad.get_direction() == S){currentPage = PAGE_6;}
                 if(pad.get_direction() == N){currentPage = PAGE_4;}
-                wait(2.0f/fps);
+                wait(1.0f/fps);
             break;
             case PAGE_6:
                 lcd.clear();
@@ -359,7 +359,7 @@
                 || (pad.check_event(Gamepad::X_PRESSED) == true)){
                     currentPage = PAGE_7;
                 }
-                wait(2.0f/fps);
+                wait(1.0f/fps);
             break;
             case PAGE_7:
                 lcd.clear();
@@ -372,7 +372,7 @@
                 lcd.refresh();
                 if(pad.get_direction() == S){currentPage = PAGE_8;}
                 if(pad.get_direction() == N){currentPage = PAGE_7;}
-                wait(2.0f/fps);
+                wait(1.0f/fps);
             break;
             case PAGE_8:
                 lcd.clear();
@@ -383,7 +383,7 @@
                 lcd.refresh();
                 if(pad.get_direction() == S){currentPage = PAGE_9;}
                 if(pad.get_direction() == N){currentPage = PAGE_7;}
-                wait(2.0f/fps);
+                wait(1.0f/fps);
             break;
             case PAGE_9:
                 lcd.clear();
@@ -411,7 +411,7 @@
                 || (pad.check_event(Gamepad::X_PRESSED) == true)){
                     currentPage = PAGE_10;
                 }
-                wait(2.0f/fps);
+                wait(1.0f/fps);
             break;
             case PAGE_10:
                 lcd.clear();
@@ -420,7 +420,7 @@
                 lcd.printString("PRESS START",0,5);
                 lcd.refresh();
                 if(pad.check_event(Gamepad::START_PRESSED) == true) {finished = true;}
-                wait(2.0f/fps);
+                wait(1.0f/fps);
             break;
         }
     }
@@ -467,7 +467,7 @@
                 lcd.refresh();
                 if(pad.get_direction() == S){currentPage = PAGE_2;}
                 if(pad.get_direction() == N){currentPage = PAGE_1;}
-                wait(2.0f/fps);
+                wait(1.0f/fps);
             break;
             case PAGE_2:
                 lcd.clear();
@@ -495,7 +495,7 @@
                 || (pad.check_event(Gamepad::Y_PRESSED) == true)){
                     currentPage = PAGE_3;
                 }
-                wait(2.0f/fps);
+                wait(1.0f/fps);
             break;
             case PAGE_3:
                 lcd.clear();
@@ -514,7 +514,7 @@
                 lcd.refresh();
                 if(pad.get_direction() == S){currentPage = PAGE_4;}
                 if(pad.get_direction() == N){currentPage = PAGE_3;}
-                wait(2.0f/fps);
+                wait(1.0f/fps);
             break;
             case PAGE_4:
                 lcd.clear();
@@ -542,7 +542,7 @@
                 || (pad.check_event(Gamepad::Y_PRESSED) == true)){
                     currentPage = PAGE_5;
                 }
-                wait(2.0f/fps);
+                wait(1.0f/fps);
             break;
             case PAGE_5:
                 lcd.clear();
@@ -561,7 +561,7 @@
                 lcd.refresh();
                 if(pad.get_direction() == S){currentPage = PAGE_6;}
                 if(pad.get_direction() == N){currentPage = PAGE_5;}
-                wait(2.0f/fps);
+                wait(1.0f/fps);
             break;
             case PAGE_6:
                 lcd.clear();
@@ -589,7 +589,7 @@
                 || (pad.check_event(Gamepad::B_PRESSED) == true)){
                     currentPage = PAGE_7;
                 }
-                wait(2.0f/fps);
+                wait(1.0f/fps);
             break;
             case PAGE_7:
                 lcd.clear();
@@ -598,7 +598,7 @@
                 lcd.printString("PRESS START",0,5);
                 lcd.refresh();
                 if(pad.check_event(Gamepad::START_PRESSED) == true) {finished = true;}
-                wait(2.0f/fps);
+                wait(1.0f/fps);
             break;
         }
     }