Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Scores/Scores.h@16:a2c945279b79, 2019-04-24 (annotated)
- Committer:
- el17mcd
- Date:
- Wed Apr 24 13:44:12 2019 +0000
- Revision:
- 16:a2c945279b79
- Child:
- 17:cb39d9fa08dc
! Player now receives score at the end of the game. leaderboard added in the menus.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| el17mcd | 16:a2c945279b79 | 1 | #ifndef SCORES_H |
| el17mcd | 16:a2c945279b79 | 2 | #define SCORES_H |
| el17mcd | 16:a2c945279b79 | 3 | |
| el17mcd | 16:a2c945279b79 | 4 | #include "mbed.h" |
| el17mcd | 16:a2c945279b79 | 5 | #include "N5110.h" |
| el17mcd | 16:a2c945279b79 | 6 | #include "Gamepad.h" |
| el17mcd | 16:a2c945279b79 | 7 | |
| el17mcd | 16:a2c945279b79 | 8 | |
| el17mcd | 16:a2c945279b79 | 9 | class Scores |
| el17mcd | 16:a2c945279b79 | 10 | { |
| el17mcd | 16:a2c945279b79 | 11 | |
| el17mcd | 16:a2c945279b79 | 12 | public: |
| el17mcd | 16:a2c945279b79 | 13 | |
| el17mcd | 16:a2c945279b79 | 14 | Scores(); |
| el17mcd | 16:a2c945279b79 | 15 | ~Scores(); |
| el17mcd | 16:a2c945279b79 | 16 | |
| el17mcd | 16:a2c945279b79 | 17 | float score_calculator(int turns, int health); |
| el17mcd | 16:a2c945279b79 | 18 | void display_score(float current, N5110 &lcd); |
| el17mcd | 16:a2c945279b79 | 19 | void display_top_scores(N5110 &lcd); |
| el17mcd | 16:a2c945279b79 | 20 | void read_sd_scores(); |
| el17mcd | 16:a2c945279b79 | 21 | void write_sd_scores(); |
| el17mcd | 16:a2c945279b79 | 22 | |
| el17mcd | 16:a2c945279b79 | 23 | private: |
| el17mcd | 16:a2c945279b79 | 24 | |
| el17mcd | 16:a2c945279b79 | 25 | void _add_to_top_scores(float new_score); |
| el17mcd | 16:a2c945279b79 | 26 | |
| el17mcd | 16:a2c945279b79 | 27 | float _top_three[3]; |
| el17mcd | 16:a2c945279b79 | 28 | |
| el17mcd | 16:a2c945279b79 | 29 | }; |
| el17mcd | 16:a2c945279b79 | 30 | |
| el17mcd | 16:a2c945279b79 | 31 | #endif // SCORES_H |