Doxygen comments added
Dependencies: mbed Gamepad N5110
Diff: Scoring/Scoring.cpp
- Revision:
- 14:9a9ac55616c4
- Parent:
- 10:75de0f4da176
- Child:
- 15:fc6b40fceb4f
--- a/Scoring/Scoring.cpp Wed May 08 21:15:33 2019 +0000 +++ b/Scoring/Scoring.cpp Thu May 09 10:25:47 2019 +0000 @@ -14,7 +14,8 @@ void Scoring::set_score(int score) { _score=score; } - bool Scoring::check_for_highscore(int highscore) { //checks if the score is higher than the highscore + bool Scoring::check_for_highscore(int score,int highscore) { //checks if the score is higher than the highscore + _score=score; _highscore=highscore; if (_score>_highscore) return true; @@ -33,7 +34,7 @@ } bool Scoring::check_collisions(int bird_y, int pipe_x, int pipe_height) { //checks for collisions by looking for - if((pipe_x>17 && pipe_x<32)&&((bird_y<(pipe_height-3)) || (bird_y>(pipe_height+26))) || (bird_y>45)) { //overlaps between the bird and the pipe + if((pipe_x>17 && pipe_x<29)&&((bird_y<(pipe_height)) || ((bird_y+5)>(pipe_height+26))) || (bird_y>43)) { //overlaps between the bird and the pipe return true; } //return true if there is a collision else { return false; @@ -56,4 +57,10 @@ wait(0.1); lcd.refresh(); } - } \ No newline at end of file + } + + + + + + \ No newline at end of file