Project Submission (late)
Dependencies: mbed
Diff: Menus/DefeatMenu.h
- Revision:
- 0:72f372170a73
- Child:
- 2:43bb635db736
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Menus/DefeatMenu.h Fri May 10 08:07:10 2019 +0000 @@ -0,0 +1,32 @@ +#ifndef DEFEATMENU_H +#define DEFEATMENU_H + +#include "VictoryMenu.h" + +/* screen that displays when the player runs out of time in the maze +reuses the yes and no buttons so VictoryMenu is included */ + +class DefeatMenu : public Menu { + public: + DefeatMenu(N5110* screenPtr) : Menu(screenPtr) { + buttons[0] = new YesButton; + buttons[1] = new NoButton; + currentButton = buttons[0]; + numOfButtons = 2; + buttonIndex = 0; + } + void virtual draw() { + std::stringstream sscore; + sscore << "Score: " << score; + lcd.printString("GAME OVER",10,1); + lcd.printString(sscore.str().c_str(),10,2); + lcd.printString("Play again?",10,3); + lcd.printString("Yes No",10,4); + } + ~DefeatMenu() { + delete buttons[0]; + delete buttons[1]; + } +}; + +#endif DEFEATMENU_H \ No newline at end of file