ELEC2645 (2018/19) / Mbed 2 deprecated el17dg

Dependencies:   mbed

Fork of el17dg by Dmitrijs Griskovs

Revision:
28:35af3843de8f
Parent:
27:f05f4e738ba9
Child:
29:579e00b7f118
--- a/menu/menu.cpp	Mon Apr 08 14:41:57 2019 +0000
+++ b/menu/menu.cpp	Wed Apr 10 15:42:10 2019 +0000
@@ -2,13 +2,12 @@
 #include "menu.h"
 #include "constants.h"
 #include "game.h"
-//#include "hud.h"
+#include "hud.h"
 
 const int total_options = 3;
 const float time_delay = 100;
-int high_score = 0;
 
-//Hud highScore;
+Hud highScore;
 
 int cursor[84] = {
     0,0,0,0,1,0,0,0,0,0,1,1,
@@ -43,16 +42,7 @@
     }
 
     drawPointer();                              // Drawing pointer only ones.
-    //highScore.drawHighScore();
-    
-    if (high_score < game_score){
-        high_score = game_score;
-    }
-    
-    //Dysplaies the higest score reached/
-    char buffer[32];
-    sprintf(buffer,"High Score %i",high_score);
-    lcd.printString(buffer,0,0);
+    highScore.drawHighScore();
         
     lcd.printString("Start Game",1,2);
     lcd.printString("Tutorial",1,3);
@@ -60,9 +50,10 @@
         
     bool option_picked = false;                 // Checking for the selecting button to be pressed and returning the boolean statement.
     if (gamepad.check_event(gamepad.A_PRESSED)){
+        gamepad.check_event(gamepad.A_PRESSED);
         option_picked = true;
     }
-    gamepad.check_event(gamepad.A_PRESSED);
+    
     return option_picked;
 }