Project Submission (late)

Dependencies:   mbed

Committer:
el17tc
Date:
Fri May 10 10:51:19 2019 +0000
Revision:
2:43bb635db736
Parent:
0:72f372170a73
Child:
3:83e79d31930c
final version, ready for API documentation;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
el17tc 0:72f372170a73 1 #ifndef DEFEATMENU_H
el17tc 0:72f372170a73 2 #define DEFEATMENU_H
el17tc 0:72f372170a73 3
el17tc 0:72f372170a73 4 #include "VictoryMenu.h"
el17tc 0:72f372170a73 5
el17tc 0:72f372170a73 6 /* screen that displays when the player runs out of time in the maze
el17tc 0:72f372170a73 7 reuses the yes and no buttons so VictoryMenu is included */
el17tc 0:72f372170a73 8
el17tc 0:72f372170a73 9 class DefeatMenu : public Menu {
el17tc 0:72f372170a73 10 public:
el17tc 0:72f372170a73 11 DefeatMenu(N5110* screenPtr) : Menu(screenPtr) {
el17tc 0:72f372170a73 12 buttons[0] = new YesButton;
el17tc 0:72f372170a73 13 buttons[1] = new NoButton;
el17tc 0:72f372170a73 14 currentButton = buttons[0];
el17tc 0:72f372170a73 15 numOfButtons = 2;
el17tc 0:72f372170a73 16 buttonIndex = 0;
el17tc 0:72f372170a73 17 }
el17tc 0:72f372170a73 18 void virtual draw() {
el17tc 0:72f372170a73 19 std::stringstream sscore;
el17tc 0:72f372170a73 20 sscore << "Score: " << score;
el17tc 2:43bb635db736 21 lcd->printString("GAME OVER",10,1);
el17tc 2:43bb635db736 22 lcd->printString(sscore.str().c_str(),10,2);
el17tc 2:43bb635db736 23 lcd->printString("Play again?",10,3);
el17tc 2:43bb635db736 24 lcd->printString("Yes No",10,4);
el17tc 0:72f372170a73 25 }
el17tc 0:72f372170a73 26 ~DefeatMenu() {
el17tc 0:72f372170a73 27 delete buttons[0];
el17tc 0:72f372170a73 28 delete buttons[1];
el17tc 0:72f372170a73 29 }
el17tc 0:72f372170a73 30 };
el17tc 0:72f372170a73 31
el17tc 2:43bb635db736 32 #endif // DEFEATMENU_H