FINAL VERSION

Dependencies:   mbed

Revision:
102:4946a6b47c78
Parent:
101:0df767523dbd
Child:
103:f9f69944a850
--- a/main.cpp	Tue May 07 17:14:21 2019 +0000
+++ b/main.cpp	Tue May 07 17:34:18 2019 +0000
@@ -39,6 +39,7 @@
 void countdown();
 void save_hi_score(int hi_score);
 int get_hi_score();
+bool compare_to_hi_score(int score);
 
 Bitmap breakwhite(breakwhite_data, 48, 84);  // assign the title screen sprites
 Bitmap breakblack(breakblack_data, 48, 84);
@@ -216,7 +217,7 @@
     lcd.printString("   B = LASER  ",0,0);
     lcd.printString(" START = PAUSE  ",0,1);
     lcd.printString("  DESTROY ALL   ",0,2);
-    lcd.printString("    BRICKS ",0,3);
+    lcd.printString("    BRICKS. ",0,3);
     arrowdown.render(lcd, 38, 43);
     lcd.refresh();
     wait(0.4);
@@ -226,6 +227,8 @@
             lcd.clear();
             lcd.printString(" CONTINUE TO  ",0,2);
             lcd.printString("INCREASE SCORE.  ",0,3);
+            lcd.printString(" BONUS SCORE  ",0,4);
+            lcd.printString("BASED ON TIME.  ",0,5);
             arrowup.render(lcd, 38, 0);
             lcd.refresh();
             wait(0.1);
@@ -357,6 +360,16 @@
         bonus = 0;
     }
     
+    if (compare_to_hi_score(bonus+breakout.get_score()) == true) {
+        lcd.clear();
+        lcd.printString(" FUCK YEAH ",2,3);
+        char buffer1[14];
+        sprintf(buffer1,"%2d",get_hi_score());
+        lcd.printString(buffer1,WIDTH/2 - 12,2);
+        lcd.refresh();
+        wait(3);
+    }
+    
     lcd.clear();
     
     char buffer1[14];