Kostadin Chakarov / Mbed 2 deprecated el17kec

Dependencies:   mbed

Revision:
9:f720f5d87420
Parent:
8:9b77eea95088
Child:
10:da5743dfb137
--- a/Ball/Ball.cpp	Wed May 08 13:49:01 2019 +0000
+++ b/Ball/Ball.cpp	Wed May 08 23:09:43 2019 +0000
@@ -74,7 +74,7 @@
 void Ball::hitPad(Paddle &paddle)
 {
     const Vector2D& posPad = paddle.getPos();
-    if (pos.y >= posPad.y - 1 && (pos.x >= posPad.x && pos.x <= posPad.x + 12)) {
+    if (pos.y >= posPad.y - 1 && (pos.x >= posPad.x && pos.x <= posPad.x + paddle.getW())) {
         /** We hit the pad */
         
         /** First: rotate about paddle's surface normal (flip upward) */