ELEC2645 (2018/19) / Mbed 2 deprecated el17szs

Dependencies:   mbed

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;
+//}