bird

Dependencies:   mbed

bird/bird.cpp

Committer:
1013373474
Date:
2019-05-04
Revision:
1:8672e52115e3
Parent:
0:3887ebee1b37

File content as of revision 1:8672e52115e3:

#include "bird.h"



void bird::init()
{   
_y = 20;
}


void bird::draw(N5110 &lcd)
{
    lcd.drawRect(30,_y,4,2,FILL_BLACK);
    lcd.drawRect(32,_y+2,1,1,FILL_BLACK);
    _y += 3;   
}


void bird::check(Gamepad &pad, N5110 &lcd)
{
    while (pad.check_event(Gamepad::A_PRESSED) == true) {
        _y -= 6;
        lcd.drawRect(32,_y+2,1,1,FILL_TRANSPARENT);
        
       }  
    }

Data bird::get_data()
{
    _data.y = _y;
    return _data;
}