Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: Bat/Bat.cpp
- Revision:
- 17:b2b651acffae
- Parent:
- 15:81a3aaf52647
diff -r 81a3aaf52647 -r b2b651acffae Bat/Bat.cpp
--- a/Bat/Bat.cpp Wed Apr 24 21:17:22 2019 +0000
+++ b/Bat/Bat.cpp Sat Apr 27 14:09:21 2019 +0000
@@ -39,6 +39,7 @@
}
return _loft_ball;
}
+/*
void Bat::first_menu(N5110 &menu_lcd){
menu_lcd.clear();
menu_lcd.printString("HERO CRICKET",5,1);
@@ -49,22 +50,18 @@
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();
-
-
-
+ second_menu(menu_lcd);
}
void Bat::second_menu(N5110 &menu_lcd){
+ printf("SECOND MENU \n");
batPad.leds_off();
menu_lcd.clear();
menu_lcd.drawRect(0,0,WIDTH,HEIGHT,FILL_TRANSPARENT);
@@ -73,18 +70,30 @@
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.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.drawCircle(72,42,5,FILL_TRANSPARENT);
+ menu_lcd.refresh();
+}
+*/
+void Bat::game_over_menu(N5110 &menu_lcd,int option){
+ if (option==1){
+ menu_lcd.clear();
+ menu_lcd.printString("GAME LOST",2,1);
+ menu_lcd.printString("NO MORE BALLS LEFT",2,3);
+ menu_lcd.refresh();
+ wait(5);
+ }
+}
+void Bat::victory_menu(N5110 &menu_lcd){
+ menu_lcd.clear();
+ menu_lcd.printString("CONGRATULATIONS!!",2,1);
+ menu_lcd.printString("YOU HAVE WON",2,3);
+ menu_lcd.refresh();
+ wait(5);
- menu_lcd.refresh();
+
}
-void Bat::game_over(string message){
- //char buffer[14];
- //int length=sprintf(buffer,"%s",message);
- //menu_lcd.printString(buffer,3,1);
-}
-