![](/media/cache/profiles/LinkedIn_0NghoZJ.jpeg.50x50_q85.jpg)
Snake vs Block Game to be run upon K64F.
Stats/Stats.h@33:249cf423fb18, 2019-04-17 (annotated)
- Committer:
- AhmedPlaymaker
- Date:
- Wed Apr 17 07:47:06 2019 +0000
- Revision:
- 33:249cf423fb18
Added Stats Class and now i can store the highest level.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
AhmedPlaymaker | 33:249cf423fb18 | 1 | #ifndef Stats_H |
AhmedPlaymaker | 33:249cf423fb18 | 2 | #define Stats_H |
AhmedPlaymaker | 33:249cf423fb18 | 3 | |
AhmedPlaymaker | 33:249cf423fb18 | 4 | #include "mbed.h" |
AhmedPlaymaker | 33:249cf423fb18 | 5 | #include "N5110.h" |
AhmedPlaymaker | 33:249cf423fb18 | 6 | #include "Gamepad.h" |
AhmedPlaymaker | 33:249cf423fb18 | 7 | #include "SDFileSystem.h" |
AhmedPlaymaker | 33:249cf423fb18 | 8 | |
AhmedPlaymaker | 33:249cf423fb18 | 9 | class Stats |
AhmedPlaymaker | 33:249cf423fb18 | 10 | { |
AhmedPlaymaker | 33:249cf423fb18 | 11 | public: |
AhmedPlaymaker | 33:249cf423fb18 | 12 | |
AhmedPlaymaker | 33:249cf423fb18 | 13 | Stats(); |
AhmedPlaymaker | 33:249cf423fb18 | 14 | ~Stats(); |
AhmedPlaymaker | 33:249cf423fb18 | 15 | |
AhmedPlaymaker | 33:249cf423fb18 | 16 | /** Stats Display |
AhmedPlaymaker | 33:249cf423fb18 | 17 | * |
AhmedPlaymaker | 33:249cf423fb18 | 18 | * This function is used to configure stats. |
AhmedPlaymaker | 33:249cf423fb18 | 19 | */ |
AhmedPlaymaker | 33:249cf423fb18 | 20 | |
AhmedPlaymaker | 33:249cf423fb18 | 21 | void StatsDisplay(N5110 &lcd, Gamepad &pad, SDFileSystem &sd); |
AhmedPlaymaker | 33:249cf423fb18 | 22 | |
AhmedPlaymaker | 33:249cf423fb18 | 23 | /** write |
AhmedPlaymaker | 33:249cf423fb18 | 24 | * |
AhmedPlaymaker | 33:249cf423fb18 | 25 | * This function is used to write to the file |
AhmedPlaymaker | 33:249cf423fb18 | 26 | */ |
AhmedPlaymaker | 33:249cf423fb18 | 27 | |
AhmedPlaymaker | 33:249cf423fb18 | 28 | void write(int level, SDFileSystem &sd); |
AhmedPlaymaker | 33:249cf423fb18 | 29 | |
AhmedPlaymaker | 33:249cf423fb18 | 30 | /** Read |
AhmedPlaymaker | 33:249cf423fb18 | 31 | * |
AhmedPlaymaker | 33:249cf423fb18 | 32 | * This function is used to read from the file |
AhmedPlaymaker | 33:249cf423fb18 | 33 | */ |
AhmedPlaymaker | 33:249cf423fb18 | 34 | |
AhmedPlaymaker | 33:249cf423fb18 | 35 | void read(SDFileSystem &sd); |
AhmedPlaymaker | 33:249cf423fb18 | 36 | |
AhmedPlaymaker | 33:249cf423fb18 | 37 | /** delete file |
AhmedPlaymaker | 33:249cf423fb18 | 38 | * |
AhmedPlaymaker | 33:249cf423fb18 | 39 | * This function allows us to delete the file |
AhmedPlaymaker | 33:249cf423fb18 | 40 | */ |
AhmedPlaymaker | 33:249cf423fb18 | 41 | |
AhmedPlaymaker | 33:249cf423fb18 | 42 | void delete_file(char filename[]); |
AhmedPlaymaker | 33:249cf423fb18 | 43 | |
AhmedPlaymaker | 33:249cf423fb18 | 44 | |
AhmedPlaymaker | 33:249cf423fb18 | 45 | char bufferlevel[14]; //this helps me print the highest level on screen. |
AhmedPlaymaker | 33:249cf423fb18 | 46 | |
AhmedPlaymaker | 33:249cf423fb18 | 47 | private: |
AhmedPlaymaker | 33:249cf423fb18 | 48 | int _stored_top_level; |
AhmedPlaymaker | 33:249cf423fb18 | 49 | int _current_level; |
AhmedPlaymaker | 33:249cf423fb18 | 50 | int _top_level; |
AhmedPlaymaker | 33:249cf423fb18 | 51 | |
AhmedPlaymaker | 33:249cf423fb18 | 52 | |
AhmedPlaymaker | 33:249cf423fb18 | 53 | }; |
AhmedPlaymaker | 33:249cf423fb18 | 54 | #endif |