Project Submission (late)
Dependencies: mbed
DefeatMenu.h
00001 #ifndef DEFEATMENU_H 00002 #define DEFEATMENU_H 00003 00004 #include "VictoryMenu.h" 00005 00006 /* screen that displays when the player runs out of time in the maze 00007 reuses the yes and no buttons so VictoryMenu is included */ 00008 00009 /** VictoryMenu Class 00010 * @brief Derived from Menu. Displayed when the timer expires. 00011 */ 00012 class DefeatMenu : public Menu { 00013 public: 00014 DefeatMenu(N5110* screenPtr) : Menu(screenPtr) { 00015 buttons[0] = new YesButton; 00016 buttons[1] = new NoButton; 00017 currentButton = buttons[0]; 00018 numOfButtons = 2; 00019 buttonIndex = 0; 00020 } 00021 void virtual draw() { 00022 std::stringstream sscore; 00023 sscore << "Score: " << score; 00024 lcd->printString("GAME OVER",10,1); 00025 lcd->printString(sscore.str().c_str(),10,2); 00026 lcd->printString("Play again?",10,3); 00027 lcd->printString("Yes No",10,4); 00028 } 00029 /** Destructor 00030 */ 00031 ~DefeatMenu() { 00032 delete buttons[0]; 00033 delete buttons[1]; 00034 } 00035 }; 00036 00037 #endif // DEFEATMENU_H
Generated on Thu Jul 14 2022 20:06:28 by 1.7.2