This class is the engine of the program. It encapsulates all the methods to do with managing scores, commands and player states(dead/alive).
Diff: Operator.cpp
- Revision:
- 3:7213eee4c093
- Parent:
- 2:6eebea9a6a86
- Child:
- 4:62dcc005f7a7
--- a/Operator.cpp Wed Apr 12 23:46:29 2017 +0000 +++ b/Operator.cpp Fri Apr 14 22:30:05 2017 +0000 @@ -12,7 +12,7 @@ void Operator::init() -{ +{ } int Operator::read_input(Controller &pad) { @@ -26,4 +26,24 @@ return ran; } - \ No newline at end of file +void Operator::Correct(Controller &pad) { + score++; + pad.led(1,1); + pad.led(2,1); + pad.led(3,1); + pad.tone(100.0,0.2); +} +void Operator::Game_Over(Controller &pad, N5110 &lcd) { + pad.tone(700.0,1); + while(pad.check_event(Controller::BACK_PRESSED) == false) { + char buffer[14]; + sprintf(buffer,"Score = %2d",score); + lcd.printString(buffer,0,1); + lcd.refresh(); + pad.leds_off(); + pad.led(4,1); + pad.led(5,1); + pad.led(6,1); +} + score = 0; +} \ No newline at end of file