Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
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;
}