Doxyjen of the Bird.h

Dependencies:   mbed N5110

Bird/Bird.cpp

Committer:
Wuuu
Date:
2019-05-05
Revision:
6:0912dfea40f5
Parent:
0:0aea7b9ba421

File content as of revision 6:0912dfea40f5:

#include "Bird.h"

Bird::Bird()
{
    
}

Bird::~Bird()
{
    
}

void Bird::init()
{
    _h = 16;
}

int Bird::draw(N5110 &lcd,Gamepad &pad)
{
    int sprite_data1[] = {
    0,0,0,0,0,0,0,0,
    0,0,0,0,0,0,0,0,
    0,0,0,1,0,0,0,0,
    0,0,0,1,1,0,0,0,
    0,0,0,1,1,1,0,0,
    0,0,0,1,1,1,0,0,
    1,1,1,1,1,1,1,1,
    1,1,1,1,1,1,1,0,
    0,0,0,0,0,0,0,0,
    0,0,0,0,0,0,0,0,
    };
    int sprite_data2[] = {
    0,0,0,0,0,0,0,0,
    0,0,0,0,0,0,0,0,
    1,1,1,1,1,1,1,0,
    1,1,1,1,1,1,1,1,
    0,0,0,1,1,1,0,0,
    0,0,0,1,1,1,0,0,
    0,0,0,1,1,0,0,0,
    0,0,0,1,0,0,0,0,
    0,0,0,0,0,0,0,0,
    0,0,0,0,0,0,0,0,
        };
    if(pad.check_event(Gamepad::A_PRESSED) == true){
        _h = _h - 7;
        Bitmap sprite(sprite_data1, 10, 8);
        sprite.render(lcd,1,_h);
    }else{
        _h = _h + 3;
        Bitmap sprite(sprite_data2, 10, 8);
        sprite.render(lcd,1,_h);
    }
    return _h;
}