Doxygen comments added
Dependencies: mbed Gamepad N5110
Bird/Bird.cpp
- Committer:
- rafeh
- Date:
- 2019-05-09
- Revision:
- 15:fc6b40fceb4f
- Parent:
- 10:75de0f4da176
File content as of revision 15:fc6b40fceb4f:
#include "Bird.h" Bird::Bird() { } Bird::~Bird() { } void Bird::init(int xpos,int ypos) { //initialises the x and y position of the bird _xpos=xpos; _ypos=ypos; } void Bird::draw(N5110 &lcd) { //draw the bird shape on the 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(_xpos,_ypos,6,6,(int*)shape); } int Bird::get_position(int y, Gamepad &pad) { //get the vertical position of the bird if (pad.check_event(Gamepad::A_PRESSED) == true) { _y = y-14; } else { _y=y+2; } return _y; }