Doxyjen of the Bird.h

Dependencies:   mbed N5110

Copter/Copter.cpp

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

File content as of revision 6:0912dfea40f5:

#include "Copter.h"

Copter::Copter()
{

}

Copter::~Copter()
{

}

void Copter::init() 
{
    _score = 0;
    _h = 0;
}
    
Vector2D Copter::get_coord(Gamepad &pad) 
{
    _ans = pad.get_coord();
    return _ans;
}

int Copter::get_h()
{
    _h = 17 * _ans.y;
    return _h;
}

void Copter::draw(N5110 &lcd) 
{
    int sprite_data[] = {
    0,0,0,0,0,0,0,0,
    0,0,0,0,0,0,0,0,
    0,0,1,1,1,1,1,0,
    0,0,0,0,1,0,0,0,
    0,0,0,1,1,1,0,0,
    0,0,1,1,1,1,1,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,
    };
    Bitmap sprite(sprite_data, 10, 8);
    sprite.render(lcd,1,19 - _h);
}
     
int Copter::get_score()
{
    _score++;
    return _score;
}