Ahmed Adamjee
/
SnakeVSBlock
Snake vs Block Game to be run upon K64F.
Diff: MenuClasses/Stats/Stats.cpp
- Revision:
- 90:741120c09784
- Parent:
- 86:fafb72e08195
--- a/MenuClasses/Stats/Stats.cpp Wed May 08 19:05:30 2019 +0000 +++ b/MenuClasses/Stats/Stats.cpp Wed May 08 21:01:20 2019 +0000 @@ -42,9 +42,9 @@ while (_pad->check_event(Gamepad::BACK_PRESSED) == false) { //Change this to if button pressed. _lcd->printString("Highest Level",3,0); _lcd->printString("Reached~",18,1); - sprintf(bufferlevel,"%d",_stored_top_level); - _lcd->drawSprite(32,22,11,25,(int *)LevelBoundary); //Function used to draw the back sprite. - _lcd->printString(bufferlevel,38,3); + _lcd->drawSprite(32,22,11,25,(int *)LevelBoundary); //Function used to draw the boundary sprite. + sprintf(_bufferlevel,"%d",_stored_top_level); + _lcd->printString(_bufferlevel,38,3); //important to draw after boundary because it needs to overlap the sprite from the centre to be seen. _lcd->refresh(); } _lcd->clear(); @@ -92,7 +92,7 @@ // now open file for reading fp = fopen("/sd/highestlevel.txt", "r"); - _stored_top_level = 0; // level 0 + _stored_top_level = 0; // To save level 0 as the default value if game has not been played yet. if (fp == NULL) { // if it can't open the file then print error message //serial.printf("Error! Unable to open file!\n");