![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Doxygen comments added
Dependencies: mbed Gamepad N5110
Scoring/Scoring.h
- Committer:
- rafeh
- Date:
- 2019-05-08
- Revision:
- 11:c85abe88ad7a
- Parent:
- 10:75de0f4da176
- Child:
- 12:736e8561b81e
File content as of revision 11:c85abe88ad7a:
#ifndef SCORING_H #define SCORING_H #include "mbed.h" #include "N5110.h" #include "Gamepad.h" class Scoring { /** Class Scoring @brief Class for counting,updating and checking scores @author Rafeh Ishtiaq @date May 2019 */ public: /** Constructor */ Scoring(); /** Destructor */ ~Scoring(); /** Sets the score @param score */ void set_score(int score); /** Displays the score and high score after the player has lost */ void display_score(N5110 &lcd, Gamepad &pad); /** Boolean function to check weather the score is higher or lower than the high score @param highscore @details The existing high score which is compared to the recent score to check for high score */ bool check_for_highscore(int highscore); /** updates the Highscore @param highscore @details The current high score */ void update_highscore(int highscore); /** Adds to the score if conditions are met (i.e. when bird gets ahead of a pipe) @param score @details The existing score @param pipe_x @details X coordinate of the pipes @param bird_x @details X coordinate of the position of the bird @param pipe_width @details Width of the pipe @returns The new score */ int add_score(int score, int pipe_x,int bird_x,int pipe_width); /** Checks for the collision between the bird and the pipes @param bir_y @details Y coordinate of the position of the bird @param pipe_x @details X coordinate of the pipes @param pipe_height @details Height of the top pipe */ bool check_collisions(int bird_y, int pipe_x, int pipe_height); private: int _score; int _highscore; }; #endif