Doxygen comments added
Dependencies: mbed Gamepad N5110
Diff: Bird/Bird.cpp
- Revision:
- 6:bc580b480ac8
- Parent:
- 3:5409b50b01b0
- Child:
- 10:75de0f4da176
--- a/Bird/Bird.cpp Thu May 02 18:42:43 2019 +0000 +++ b/Bird/Bird.cpp Mon May 06 10:57:08 2019 +0000 @@ -14,16 +14,41 @@ - //void Bird::init(int xvalue,int yvalue) { + void Bird::init(int xpos,int ypos) { - //xvalue = _xvalue; - //yvalue = _yvalue; - //} + _xpos=xpos; + _ypos=ypos; + + } - //void Bird::draw(N5110 &lcd) { + void Bird::draw(N5110 &lcd) { + + const int shape [6][6] = +{ + 0,0,1,1,0,0, + 0,1,0,1,1,0, + 1,0,1,1,1,1, + 1,1,1,1,1,0, + 0,1,1,1,1,0, + 0,0,0,0,0,0, + + }; - //lcd.drawSprite(_xvalue,_yvalue,6,6,(int*)movingbird); - //} - \ No newline at end of file + lcd.drawSprite(_xpos,_ypos,6,6,(int*)shape); + } + + int Bird::get_position(int y, Gamepad &pad) { + + if (pad.check_event(Gamepad::A_PRESSED) == true) { + _y = y-14; + } + else { + _y=y+2; + } + return _y; + } + + + \ No newline at end of file