bird

Dependencies:   mbed

bird/bird.cpp

Committer:
1013373474
Date:
2019-05-06
Revision:
6:9bf0273ee25f
Parent:
1:8672e52115e3

File content as of revision 6:9bf0273ee25f:

#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;
}