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
Fork of el17dg by
Diff: game/hud.h
- Revision:
- 29:579e00b7f118
- Parent:
- 28:35af3843de8f
- Child:
- 30:d454d0cb72bc
--- a/game/hud.h Wed Apr 10 15:42:10 2019 +0000 +++ b/game/hud.h Mon Apr 15 12:59:51 2019 +0000 @@ -3,30 +3,34 @@ #include "game.h" +/**Hud Class + * @brief A library for describing the player's heads up display(hud). + * @author Dmitrijs Griskovs + * @date 15/04/2019 + */ class Hud { public: -/** Draws an in-game score on the screen. - */ +/** @brief Draws an in-game score on the screen during the gameplay. */ void drawScore(){ char buffer[16]; sprintf(buffer," Score: %i",game_score); lcd.printString(buffer,0,0); } - +/**@brief Displays the highest score reached in the main menu. */ void drawHighScore(){ if (high_score < game_score){ high_score = game_score; } - //Displays the highest score reached. char buffer[16]; sprintf(buffer,"High Score %i",high_score); lcd.printString(buffer,0,0); } -/** Cheks the palyer's life value and lights the LEDs on/off accordingly to - * how many lifes are left. - */ +/** @brief mointors, updates and shows the player's lives + * @details Checks the palyer's life value and lights the LEDs on/off accordingly to + * how many lifes are left. green = 3, yellow = 2 and red = 1. + */ void displayLifes(){ //printf("displayLifes:: %i\n", player_lifes); if (player_lifes == 3){ @@ -69,7 +73,6 @@ red_led_state = !red_led_state; } red_led_flashing += 1; - } };