ELEC2645 (2018/19) / Mbed 2 deprecated el17szs

Dependencies:   mbed

Bat/Bat.cpp

Committer:
shahidsajid
Date:
2019-04-20
Revision:
8:7b7e1a5b8200
Parent:
6:3e50f2cf4366
Child:
33:9d34ef219fff

File content as of revision 8:7b7e1a5b8200:

#include "Bat.h"


Bat::Bat()
{

}

Bat::~Bat()
{

}
void Bat::init(int x,int y)
{   
    batPad.init();
    _x = 42;
    _y = 15;
    _hitBall=0;
}
void Bat::draw(N5110 &lcd){
    lcd.drawLine(38,36,41,36,1);
    lcd.drawRect(41,35,6,3,FILL_BLACK);
}
int Bat::get_hitBall(){
    if (batPad.check_event(Gamepad::A_PRESSED) == true){
        _hitBall=1;
    }
    printf("HIT BALL %i \n",_hitBall);
    return _hitBall;
}
Direction Bat::get_ballDirection(){
    _d=batPad.get_direction();
    return _d;
}