ELEC2645 (2018/19) / Mbed 2 deprecated el17cd

Dependencies:   mbed

Revision:
29:4a02f0bae202
Parent:
27:e46af658c67a
Child:
30:91038c2afec7
diff -r f8ff7c8c1627 -r 4a02f0bae202 Rasturizer/Rasturizer.cpp
--- a/Rasturizer/Rasturizer.cpp	Thu Apr 04 21:47:00 2019 +0000
+++ b/Rasturizer/Rasturizer.cpp	Thu Apr 04 22:04:10 2019 +0000
@@ -134,10 +134,10 @@
     lcd.printString(text, x, y);
 }
 
-void Rasturizer::printScore(int score){
+void Rasturizer::printScore(int score, int x, int y){
     char buffer[5];
     sprintf(buffer, "%d", score/3);
-    print(buffer, 0, 0);
+    print(buffer, x, y);
     memset(buffer, 0, sizeof buffer);    
 }
 
@@ -154,7 +154,7 @@
     lcd.turnOff();
 }
 
-void Rasturizer::drawDeathScreen(bool selection){
+void Rasturizer::drawDeathScreen(bool selection, int highScore){
     Face faces[6];
     int x;
     int y;
@@ -171,6 +171,7 @@
         z = 50;
     }
     
+    printScore(highScore, 40, 0);
     drawDeathButtons();
     drawSelectionCube(x, y, z, 2);
 }