ELEC2645 (2018/19) / Mbed 2 deprecated 2645_Project_SiutingWong201186503

Dependencies:   mbed

Revision:
11:4723e7f3f1d2
Parent:
10:961bf7a76f45
Child:
12:660458c41c8e
--- a/main.cpp	Thu May 09 03:40:19 2019 +0000
+++ b/main.cpp	Thu May 09 03:49:59 2019 +0000
@@ -148,7 +148,7 @@
 ///////////// functions ////////////////
 int main() {
     while (1) {
-        int fps = 8;
+        int fps = 6;
         
         init();     // initialise and then display welcome screen...
         welcome();
@@ -161,6 +161,15 @@
             eng.update(pad);
             render();
             wait(1.0f/fps);
+            if (eng.get_score() == 3) {
+                fps = 9;
+            }
+            if (eng.get_score() >= 4) {
+                fps = 12;
+            }
+            if (eng.get_score() >= 5) {
+                fps = 15;
+            }
             if (eng.get_score() == 6) {
                 fingersnap();
                 break;