ELEC2645 (2018/19) / Mbed 2 deprecated el17zl

Dependencies:   mbed

Fork of el17zl by Zhenwen Liao

Revision:
8:83891ea9a5d9
Parent:
7:6f8aeadc4370
Child:
13:5930f0e5889d
--- a/Ppl/Ppl.cpp	Thu Apr 11 14:14:28 2019 +0000
+++ b/Ppl/Ppl.cpp	Mon Apr 15 06:55:01 2019 +0000
@@ -108,15 +108,15 @@
     if (temp == 0 ) {
         _y = _y;
         _x = _x;
-    } else if (temp == 1) {
+    } else if (temp == 1 && _x <=10) {
         _x = 10;
-    } else if (temp == 2) {
+    } else if (temp == 2 && _x >=66) {
         _x = 66;
-    } else if (temp == 3) {
+    } else if (temp == 3 && _y <=12 ) {
         _y = 12;
-    } else if (temp == 4) {
+    } else if (temp == 4 && _y >=28) {
         _y = 28;
-    }
+    } 
 }
 
 void Ppl::hold_ppl_against_wall() // check the y origin to ensure that the paddle doesn't go off screen