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
Diff: Bat/Bat.cpp
- Revision:
- 13:924891519a95
- Parent:
- 12:954da4f4e565
- Child:
- 15:81a3aaf52647
--- a/Bat/Bat.cpp Tue Apr 23 12:46:34 2019 +0000
+++ b/Bat/Bat.cpp Tue Apr 23 14:35:39 2019 +0000
@@ -17,7 +17,10 @@
_y = 15;
_hitBall=0;
}
-
+void Bat::reset(){
+ _hitBall=0;
+ _loft_ball=0;
+}
void Bat::draw(N5110 &lcd){
lcd.drawLine(38,36,41,36,1);
lcd.drawRect(41,35,6,3,FILL_BLACK);
@@ -29,7 +32,13 @@
}
return _hitBall;
}
-Direction Bat::get_ballDirection(){
- _d=batPad.get_direction();
- return _d;
+int Bat::get_loft_ball(){
+ if (batPad.check_event(Gamepad::L_PRESSED) == true){
+ _loft_ball=1;
+ }
+ return _loft_ball;
}
+//Direction Bat::get_ballDirection(){
+// _d=batPad.get_direction();
+// return _d;
+//}