ELEC2645 (2018/19) / Mbed 2 deprecated el17szs

Dependencies:   mbed

Revision:
26:6427f09cf8d3
Parent:
20:9d21599fe350
Child:
28:d0b0a64a832d
--- a/Ball/Ball.cpp	Wed May 01 09:08:03 2019 +0000
+++ b/Ball/Ball.cpp	Wed May 01 11:56:36 2019 +0000
@@ -18,9 +18,9 @@
     _x = 42;
     _y = 15;
     _ball_count=0;
-    set_tone=0;
+    _set_tone=0;
     bat.init(3,4);
-    bowled=0;
+    _bowled=0;
     _ball_count=0;
 
 }
@@ -30,27 +30,15 @@
 int Ball::get_ball_count(){
     return _ball_count;
 }
-
-Vector2D Ball::get_pos()
-{
-    Vector2D p = {_x,_y};
-    return p;
-}
-
-void Ball::set_pos(Vector2D p)
-{
-    _x = p.x;
-    _y = p.y;
-}
 int Ball::bowler_start(Gamepad &pad){
     if(_y1!=15){
         _y1+=1;
         return 0;
     }
     else {
-        if (set_tone==0){
+        if (_set_tone==0){
             //pad.tone(750.0,0.3);
-            set_tone=1;
+            _set_tone=1;
         }
         return 1;
     }
@@ -64,7 +52,7 @@
             return 0;        
         }
         else{
-            bowled=1;
+            _bowled=1;
             return 1;
         } 
     }  
@@ -112,13 +100,13 @@
 
 
 void Ball::reset(){
-    bowled=0;
-    ballHit=0;
+    _bowled=0;
+   
     _x1=42;
     _y1=3;
     _x = 42;
     _y = 15;
-    set_tone=0;
+    _set_tone=0;
     //_ball_count=0;
 }