yr
Diff: play.cpp
- Revision:
- 0:de980644a94b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/play.cpp Tue Mar 30 14:11:21 2021 +0000 @@ -0,0 +1,100 @@ +#include "play.h" + +void store_score() { + + if(score > best_score) { + + best_score = score; + + } + +} + +void get_start(N5110 &lcd) { + + lcd.clear(); + + lcd.printString("LET'S START!",1,2); + + lcd.refresh(); + + thread_sleep_for(100); + + // **************0 + + lcd.clear(); + + lcd.printString("3",40,2); + + lcd.refresh(); + + thread_sleep_for(100); + + // **************3 + + lcd.clear(); + + lcd.printString("2",40,2); + + lcd.refresh(); + + thread_sleep_for(100); + + // **************2 + + lcd.clear(); + + lcd.printString("1",40,2); + + lcd.refresh(); + + thread_sleep_for(100); + + // **************1 + +} + +void show_score(N5110 &lcd, DigitalIn &button_A) { + + lcd.clear(); + + lcd.printString("BEST SCORE",12,1); + + char buffer[14]; + sprintf(buffer,"%d",best_score); + lcd.printString(buffer,12,3); + + lcd.printString("Press A BACK",0,5); + + lcd.refresh(); + + while(1) { + + if(button_A.read() == 1) { + choice(); + } + } + +} + +// +//InGame::InGame() {} +// +//void InGame::draw_background1(N5110 &lcd) { +// +// lcd.clear(); +// +// lcd.drawLine(0,8,84,7,1); +// lcd.drawRect(23,26,26,4,FILL_BLACK); +// lcd.drawRect(0,44,84,4,FILL_BLACK); +// lcd.drawRect(28,40,26,4,FILL_BLACK); +// lcd.drawRect(67,22,17,11,FILL_TRANSPARENT); +// +// lcd.refresh(); +// +//} + + + + +