ELEC2645 (2018/19) / Mbed 2 deprecated el17szs

Dependencies:   mbed

Revision:
15:81a3aaf52647
Parent:
13:924891519a95
Child:
16:da0808d55de0
Child:
17:b2b651acffae
Child:
18:a260ce8db9e7
diff -r 122eaa3b7a50 -r 81a3aaf52647 Bat/Bat.cpp
--- a/Bat/Bat.cpp	Tue Apr 23 20:57:15 2019 +0000
+++ b/Bat/Bat.cpp	Wed Apr 24 21:17:22 2019 +0000
@@ -34,11 +34,57 @@
 }
 int Bat::get_loft_ball(){
      if (batPad.check_event(Gamepad::L_PRESSED) == true){
+        //badPad.tone(750.0,0.1);
         _loft_ball=1;
     }
     return _loft_ball;
 }
-//Direction Bat::get_ballDirection(){
-//    _d=batPad.get_direction();
-//    return _d;
-//}
+void Bat::first_menu(N5110 &menu_lcd){
+    menu_lcd.clear();
+    menu_lcd.printString("HERO CRICKET",5,1);
+    menu_lcd.refresh();
+    menu_lcd.printString("game by el17szs",2,3);
+    wait(1);
+    menu_lcd.refresh();
+    menu_lcd.printString("PRESS START..",1,5);
+    wait(1);
+    menu_lcd.refresh();
+    
+    menu_lcd.refresh();
+    while (batPad.check_event(Gamepad::START_PRESSED) == false) {
+            printf("2");
+            batPad.leds_on();
+            wait(0.1);
+            batPad.leds_off();
+            wait(0.1);
+        }
+        second_menu(menu_lcd);
+        batPad.leds_off();
+        
+       
+
+}
+void Bat::second_menu(N5110 &menu_lcd){
+    batPad.leds_off();
+    menu_lcd.clear();
+    menu_lcd.drawRect(0,0,WIDTH,HEIGHT,FILL_TRANSPARENT);
+    menu_lcd.printString("START GAME",2,1);
+    menu_lcd.printString("A",70,1);
+    menu_lcd.drawCircle(72,11,5,FILL_TRANSPARENT);
+    menu_lcd.printString("RULES",2,3);
+    menu_lcd.printString("B",70,3);
+     menu_lcd.drawCircle(72,27,5,FILL_TRANSPARENT);
+    menu_lcd.printString("CONTROLS",2,5);
+    menu_lcd.printString("Y",70,5);
+     menu_lcd.drawCircle(72,42,5,FILL_TRANSPARENT);
+    
+    menu_lcd.refresh();
+    
+}
+
+void Bat::game_over(string message){
+    //char buffer[14];
+    //int length=sprintf(buffer,"%s",message);
+    //menu_lcd.printString(buffer,3,1);
+}  
+