Doxygen comments added

Dependencies:   mbed Gamepad N5110

FlappyBirdEngine/FlappyBirdEngine.cpp

Committer:
rafeh
Date:
2019-05-06
Revision:
7:05f433e196d6
Child:
8:d91564c0f337

File content as of revision 7:05f433e196d6:

#include "FlappyBirdEngine.h"



void FlappyBirdEngine::get_score(int score) {
        _score=score;
        }
        bool FlappyBirdEngine::check_for_highscore(int highscore) {
            _highscore=highscore;
            if (_score>_highscore) 
            return true;
            else 
            return false;
            }
    void FlappyBirdEngine::update_highscore(int highscore) {
        _highscore=highscore;
        }
        
    void FlappyBirdEngine::display_score(N5110 &lcd, Gamepad &pad) {
        lcd.clear();
        char score_display[16];
        char highscore_display[20];
        sprintf(score_display,"Score : %d",_score);
        lcd.printString(score_display,0,0);
        sprintf(highscore_display,"High Score : %d",_highscore);
        lcd.printString(highscore_display,1,1);
         while ( pad.check_event(Gamepad::A_PRESSED) == false) {
        pad.leds_on();
        wait(0.1);
        pad.leds_off();
        wait(0.1);
        lcd.refresh();
        }
        }