A complex 2D-dungeon game on LPC1768 in SWJTU-Leeds Joint School XJEL2645 project. Referenced from the framework contributed by https://os.mbed.com/users/Siriagus/code/SimplePlatformGame/
Dependencies: mbed N5110 ShiftReg PinDetect
Diff: Global.cpp
- Revision:
- 17:d6a3b29cab31
- Child:
- 19:89c3eeb3761b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Global.cpp Mon May 11 03:52:18 2015 +0000 @@ -0,0 +1,27 @@ +#include "Global.h" + +/// @file Global.cpp + +namespace Global +{ + int score = 0; + Highscore highscores[3] = {{"AAA", 0}, {"AAA", 0}, {"AAA", 0}}; + + void clearHighscoreList() + { + // Clear high score list + for (int i = 0; i < 3; ++i) + { + highscores[i].initials = "---"; + highscores[i].score = 0; + } + + // Overwrite file + FILE *fp = fopen("/local/highscores.txt", "w"); + + for (int i = 0; i < 3; ++i) + fprintf(fp, "%s %d ", Global::highscores[i].initials, Global::highscores[i].score); + + fclose(fp); + } +} \ No newline at end of file