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.
Diff: PongEngine/PongEngine.cpp
- Revision:
- 16:1761dfe801af
- Parent:
- 14:38560375d420
- Child:
- 18:e5eb50c5e61f
diff -r b867a6620f96 -r 1761dfe801af PongEngine/PongEngine.cpp
--- a/PongEngine/PongEngine.cpp	Tue Apr 23 17:09:47 2019 +0000
+++ b/PongEngine/PongEngine.cpp	Tue Apr 23 17:51:42 2019 +0000
@@ -71,10 +71,17 @@
     //listofBricks.push_back(_brick36);
 }
 
-void PongEngine::read_input(Gamepad &pad)
+void PongEngine::read_input(Gamepad &pad, bool x)
 {
     _d = pad.get_direction();
     _mag = pad.get_mag();
+    
+    if (x == true) {
+        _p1.set_tilt();
+    }
+    else {
+        _p1.set_joy();
+    }
     //_pause = pad.check_event(Gamepad::START_PRESSED);   // == false then system("PAUSE") or cin.get()
 }
 
@@ -142,7 +149,6 @@
     // correct for it before updating the display
     _p1.update(_d,_mag);
     _ball.update();
-    
     lives_leds(pad);
     
     check_wall_collision(pad);